I need help for a particular situation. In WooCommerce, if “Manage Stock” is enabled for a simple product or variation, then a notification is being displayed in the product page => such as [this example][1] However, if “Manage Stock” is not enabled, then there is no notification wh…
Tag: wordpress
WordPress – template part break wordpress columns layout
I think that some help will be appreciated. I have this code that will load two template part for a wordpres custom theme: As you can see under the hood I’m using bootstrap 4 so it’s supposed that the content will align itself inside the same row. I have a col-8 inside the main-news.php and a col-…
PHP How to extract non serialize array into variables
How can I convert the following array stored in my database into a PHP array, and then extract them into PHP variables: {“wpversion”:”5.4.2″,”debug_mode”:false,”…
Change FlexSlider options on mobile in Woocommerce
By default on single product page enabled option ‘controlNav’ = ‘thumbnails’. It’s ok for desktop. But on mobile i want to be ‘controlNav’ = true (dots). I tried to do it with ajax, but I think I need somehow refresh that fragment with flex slides to apply filter. I c…
Combining multiple cart item permalink changes in WooCommerce
I would like to change the permalinks of my cart item using the WooCommerce framework. I have the following: function addCustomFieldToUrl_1($permaLink, $cart_item, $cartItemId){ …
Countdown timer until product sale ends on WooCommerce single product page
My goal with this, as I am learning, is to add a countdown timer after the add to cart form on the product page that counts down the time left until the sale is over. I’m using “How TO – JavaScript Countdown Timer” from the w3schools website and I wrote code for getting the _sale_price…
How to show all images in WooCommerce product description
I want to replace my product description by my description + all product images (include variation product images) in single product page. I can do that with Magento but now when change to Woocommerce …
Woocommerce minimum order total based on user roles
I’m using a snippet code from Woocommerce Minimum Order Amount to set a minimum order total. But I would like to set different minimums per user role. I have some custom user roles: wholesale_prices, wholesale_vat_exc, and distributor_prices. I want to make the code to work based on use roles with diffe…
If less than 1 month convert timestamp to time ago in PHP
I’m sure there are many similar questions but I already tried many of them it seems impossible to get the results I want. So what I want is to convert the timestamp on my WordPress posts to show “…
Limit WooCommerce products in cart only from one custom taxonomy
I’m trying to restrict customers on my Woocommerce store to only be allowed to order products from 1 “supplier” at a time. I am defining the “Supplier” by a custom taxonomy called &…