The easiest way is a double/nested foreach loop. Post here what you have so it is easier to write on top of that than to guess everything.
DB Design for Attributes with multiple values + Variants
Hi there, I have this design for the following flow: 1.You can add Attributes Size, Color. 2.Then you can add possible values to those attributes S,M,L, XL / Red,Green,Blue,White
In the product create/edit page you can first select the product attributes and values. So you choose attributes Size and Color and then you are presented with selects to choose from all possible values and associate them with the product.
So you end up with Sizes: S,M,L and Color: Red,Green.
That part is easy, I already done it, but now the next one is tricky..
You can make variations out of the attributes and values you just picked, so you want to make variants for the product with
Size: S Color: Red, Size M, Color: Red, Size S, Color: Green, Size M, Color: Green,
I can't wrap my head around the variations parts..
This is the DB Design I am trying to put to work:
https://i.stack.imgur.com/ODiCE.png
Any suggestions would be much appreciated
Please or to participate in this conversation.