Jump to content

How can I create and add all possible combinations for a product at once?


Recommended Posts

Hello, I want to create all possible combinations of a product at once, programmatically. I can see this function addAttributeCombinationMultiple in the product.php class to add them to the product but I do not know how to create all the possible combinations.

 

 

Any help would be greatly appreciated!

Link to comment
Share on other sites

Thanks for the reply selectshop.at but I want to accomplish this programmatically through my module. I want to create a controller which will generate all possible combinations for a product, instead of generating them one by one like the default product combination generator. Is there no way to do this?

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the reply selectshop.at but I want to accomplish this programmatically through my module. I want to create a controller which will generate all possible combinations for a product, instead of generating them one by one like the default product combination generator. Is there no way to do this?

 

well, you can get all combinations by using cartesian product between your attributes. Be aware that this may produce very big dataset, depending on cardinality of your attributes.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...