Hello i have a problem and i wanted your expertise on how i can solve it.I want to create products based on different variations.lets say i have
var size = ["sm","xs","large"];
var material = ["cotton","gold"];
var gender: ['Men', 'Women']
My desire output is lets all the different combinations of n arrays in this case
var output = ["sm cotton men","sm gold women" , ...]
My problem is that all the possible solutions that i have found on the internet support 3-4 arrays with 10 variations inside.I wanted to support n arrays with lets say 50 variations each.I have found code sample in stackoverflow but all of them breaks if i used a lot of variations.
somehow i want to put a limit px 50 max and then when the user click the button button again the algorithm run and finished the next 50 until there is no other possible combinations.
so far i have found this code here : Create product variants based on attributes
that works good but its not scalable enough.I want to do the same thing that wordpress does with woocomerce