The situation is the following:
In my app every product has attributes. for example a shirt has color,
neck size and sleeve size.
A jacket has color and jacket size.
Those attributes have values.
Colors: black, white, green, red etc
Neck size: 14, 15, 16, 16 etc
sleeve size: 20,21,22,23,24 etc
jacket size: S, M, L, XL
what I want to achieve is dynamically list all the available combination
(variation) of attributes for a specific type of product.
a shirt can have a combination of 4 colors, 5 neck sizes and 7 sleeve
sizes = 140
so I want my app to list all the available variations for shirts like
black, 14, 20
black, 14, 21
black, 14, 22
and so on (all 140 variations in this case)
so first I want to loop through sleeve size attributes, and then neck
size and finally colors.
what's the best solution to achieve that? it has to be dynamic, so if
the product is a jacket it has to know that it has 2 attributes (color
and size) so it will loop through those like this:
and so on.
has anyone encountered that kind of problem and found a good solution?
Thanks for everyone.