TL;DR version How do I change the name that is automatically generated for variable products? Detailed version The product variations all get names based on the variable attributes they generate from. Example Let’s say that there’s the varible product: Vase. Vase has the attribute: Condition, with…
Tag: product
Hide all products with a specific stock status from WooCommerce catalog
I’m using Flatsome template on WordPress and Woocommerce site. I also create custom stock status (example noproduzione, used when a product is not created anymore from manufacturer). But I don’t want to show this products (noproduzione stock status) on my site (only in admin pages). I’m usin…
WooCommerce programmatically created product ignores prices sorting filter
I have following function to create new woocommerce product on the frontend. parse_str($_POST[‘form_data’], $form_data); $insertPost = array( //’ID’ => $post_id, ‘post_title’ => …
Show created and modified product date on WooCommerce pages
I’m looking for solution to display products current date on the shop page. I have tried with this, but it shows nothing at all Any help is appreciated. Answer The following code shows the date the product was created and modified on the single product page and archive/Shop page Note: the time/date disp…
Disable add to cart button via custom checkbox in WooCommerce product settings
We want to prevent add to cart for certain upcoming products. We want to have a checkbox to select the specific product on which we want to prevent add to cart. We have right now the checkbox and save code. I also found this: Remove add cart button in Woocommerce for a specific product category and https://wi…
Display WooCommerce Product Dimensions via a Shortcode
I am creating a custom layout (using Elementor) for a product – what I need is to have the dimensions of a product to display in a custom tab I have created. Is there a shortcode for product dimensions? (some of the products are variable too if that makes a difference) I have managed to get some code to…
Hide or edit the “You cannot add another ‘xxx’ to your cart” error message in WooCommerce 4.5+
Via the product settings I enabled “sold individually: enable this to only allow one item to be bought in a single order” While adding the same product to cart, there appears an error message because I enabled this setting. The error message is “You cannot add another ‘xxx’ to yo…
Add permalink to product title in WooCommerce custom order history
I am using Show products name and quantity in a new column on Woocommerce My account Orders answer code to add an additional column to the Woocommerce My Account Order History page that displays the titles of items for the order. How would I make the code display the title as a hyperlink to the product page o…
Custom “Out of stock” text based on product category in WooCommerce
Every out of stock product says “Out of Stock” There are plenty of functions.php scripts that overwrite the text but I am only trying to overwrite the text specific to “Category A” or if I know the category “id” number, that could work too. I found this script but it allows…
Add and wrap product categories WordPress/Woocommerce in product loop
I use this snippet for display product categories in product loop on Shop and archives pages: I want this: To achieve this I use jQuery: How can I modify my PHP snippet to avoid using jQuery? Answer You could just append the corresponding tag before & after your foreach loop: Then you don’t need to …