Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

108
Views
Generate products from different variations

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!