Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

112
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda