How can I get an array of variations
-
Hello. I need to get an array with the variations (including their attributes value, price, and variation id) based on the product id. For example if I have a product called “Shirt” with id 1234 and it has two attributes: size and color withe the values “S”, “M” and “Blue”, “Green” I need to get an array that looks at minimum like this:
1234[
Name => “Shirt”,
Variations =>
12341[ Size => “S”, Color => “Blue”, Price => “123”],
12342[ Size => “S”, Color => “Green”, Price => “543”],
12343[ Size => “M”, Color => “Blue”, Price => “432”],
12344[ Size => “M”, Color => “Green”, Price => “153”]
]Is it possible? I don’t need to be exactly like that just that I need an array including all these details at minimum.
Thanks!
- The topic ‘How can I get an array of variations’ is closed to new replies.