Following Loic’s workflow here Can I get all the variations related to the product basing on one particular variation in default value. Example: Get all variations with attribute_pa_sizes similar to the default value’s attribute_pa_sizes echo $variation_values[‘attributes’][‘attribute_pa_sizes’] . ‘: ‘ . $price ; Answer This can be done with the following code (based on this answer): Tested and works
Tag: woocommerce
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
Display Custom Total Saving in generated invoice in WooCommerce 3
In WooCommerce I am using WooCommerce Print Invoices & Packing lists plugin… How can I display the total savings of any order in the invoices generated by this plugin ? 1 year ago I have been using this code based on [this answer] and that was working before I updated WooCommerce : So now it doesn’t works anymore. I have
Woocommerce: custom jquery event after added to cart
I’m trying (in archive) handle event after some product was added to cart (1 action on picture), I want catch that moment and update “Total number of products” (3 action on picture) of my mini cart in navigation menu. (With action 2 is all ok) Not working for me with second code: My custom code inited after when woocommerce js
Display shipping methods to frontend as in the admin panel?
In WooCommerce, I’m doing the form of adding / changing product (at the front-end). I need to display the fields for changing the cost of delivery of the installed methods as in the admin panel. How can I do it? Here is my actual code: Answer As Shipping Methods are connected to a Shipping Zone, WooCommerce need to know which
Woocommerce Progressive extra cost based on total number of items in the cart
I am looking for some code which can make an extra charge based on the total number of items in the cart like: If number of items in cart is > 6 ===> extra cost = 5 If number of items in cart is > 12 …
Set “flat rate” shipping method as default in woocommerce
I have a woocommerce website and I have set 2 shipping methods: – Flat Rate – Local pickup I would like to set the “Flat rate” shipping method as default (selected) in the cart or checkout page. Any help should be appreciated. Answer 1) You can use the following code (to set “flat rate” shipping method as default) In cart
Display woocommerce product dimensions in separate lines
I found the way to display the dimensions in separate lines by copy product-attributes.php file to my child-theme and replace: has_dimensions(…
WooCommerce discount: buy one get one 50% off
I wish to set up a specific discount on a particular variable products, if customer buys one product they get the another(same) on 50% discount(Buy one get another for 50% off). I’ve tried many discount plugins buy the closest that I have found are: Pricing Deals for WooCommerce WooCommerce All Discounts Lite WooCommerce Extended Coupon Features By using these plugins
How to change category thumbnail size in WooCommerce
With the following code I managed to display my featured categories title, description and thumbnail. When I uploaded the thumbnail, it was 500 * 500 in its dimensions. But when I visit the page I see the thumbnail being cropped as 150 * 150. How can I change the size of my categorythumbnails? It is my first time doing a