I would like to replace the dash ( – ) with round brackets ( ) around WooCommerce product variation names. Normally a WooCommerce product variation is displayed like this: Sometimes this dash can be confused by a minus, and it looks like it’s the main product minus the variation. This depends on both the product and variation names. So the
Tag: variations
How can I show individual stock quantities for variable products on the product page in WooCommerce
I am trying to show each variable products stock quantity on the single product page in WooCommerce. I have managed to show all the stock quantities for all the variations using the below code from …
Add variation stock quantity and status to Woocommerce product variation dropdown
Based on “Show stock status next to each attribute value in WooCommerce variable products”, I have the following code that shows stock quantity + stock status in product variation dropdown and also as displayed product availability text: But I am having an issue with this code: for ex. I have a product with size (stock): S (instock qty 2), L(0),
Change product stock availability texts in Woocommerce
I am trying to change the in stock text next to the quantity available in woocommerce. I am using the stock management in product variations. I tried this code below: The code above changes the text but it does not pull in the stock quantity number from the variation stock manager. Any help is appreciated. Answer The following code will
Add the variation price to variable product dropdown item names in Woocommerce
I’m using this code to get the variable product options I tried a lot of codes to get price next to the name in dropdown menu , but nothing get right Answer It will only work if you have just one product attribute for variations set in the variable product (so only one dropdown). If you have more than one
Get the selected variation attributes from orders in Woocommerce 3
In Woocommerce, I have a report in the admin area that tallies up products sold.There are only 5 products sold on the site but there are 1 or 2 variations on some. The report works great but ignores the variations. I need to retrieve the attribute value from items ordered to display the data accurately. How do I do this?
Creating WooCommerce product variation adds an empty attribute value
When adding variations to a WooCommerce product it is adding in a blank attribute. Meaning that when I try to add in my own attribute it gets appended to an existing array. Example code I am running: Then when I var_dump($product_variation); I get the following: So when I view the product in WooCommerce admin all my variations are there but
Update all variations prices of a variable product in Woocommerce
I need to get all variation id and update price in loop. Simple query and loop looks like: I think not working this: or this: Answer First in your code ‘ or ’ should be replaced by ‘. Also if used $post-ID should be replaced by $post->ID Depending on where and how you are using this code, you should try