I have such a product example:
{
"color": ["red", "blue"],
"material": ["metal", "textile", "plastic"],
"options": ["handle", "wire", "bt"],
"textile": ["silk", "cotton"]
}
I need to know what algorithm can help me to produce all options possible for such product, f.e.:
{
"color": "red",
"material": "metal",
"options": "handle",
"textile": "cotton"
}
Each option can be single for a product.
Obviously, I don't want to use tons of for loops. It should be possible to easily add new options and new variations, f.e.:
{
"color": ["red", "blue", "new"],
"material": ["metal", "textile", "plastic", "new"],
"options": ["handle", "wire", "bt", "new"],
"textile": ["silk", "cotton", "new"],
"newOption": ["new option]
}