Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

111
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda