Skip to content
Advertisement

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 ;

Advertisement

Answer

This can be done with the following code (based on this answer):

JavaScript

Tested and works

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement