Skip to content
Advertisement

Tag: product-variations

Enhanced WooCommerce Custom Fields for Variations

Using the Remi Coulson tutorial, a custom field has been added for product variations. This works, however the custom field is positioned by the add-to-cart button. I wish to position it within Additional Information tab. I have tried adding the front end code to the additional-information.php but it does not display. Added to functions.php to display variation Answer Note that

How to get current selected variable product specific data in WooCommerce

I want to access the selected product variation Weight value in php. I tried below code its getting last value of attribute, not selected. Answer The selected variation properties can only be accessed via Javascript as it’s a client side live event… Here below is an example, that will display the selected variation custom attribute “attribute_weight” term slug for the

Get all Product Variations based on one default attribute value in WooCommerce

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

Set variations default attributes values for a variable product Programmatically

I’m building a site where WooCommerce Variable products (with Products Variations) are inserted programmatically. I have followed this tutorial successfully: Insert WooCommerce Products & Variations Programmatically I need just something that is missing: How to set variations default attributes values for a variable product? Is it possible? Answer 1). You will need to insert in your json data for each

Advertisement