One button to add two related products


First, I'm french so sorry for my English medium.

I develop a store with Drupal Commerce.

I have two product types.
That's what I want to do.

Both types of products should be sold together.
I can't use options because I really have the concept of product 1 and product 2.
Each product 1 can be sold with a certain product 2.

I want to have a display like this:

Type 1
x Product 1-1
x Product 1-2
x Product 1-3

Type 2
x Product 2-1
x Product 2-2
x Product 2-3

Add to cart

Finally, the button "add to cart" must to add the two selected products (a product of type 1 and a product og type 2 product).

Is it possible to do this ? Can you help me ?

For now, all I've done is create a content type with a field "product reference" but the module creates content with a drop down list to choose the product among those that I give.

I don't know where to look, thank you very much for your help!

Posted: Apr 23, 2012


mwisner on April 24, 2012

I would try looking into rules first...

There are event triggers for products being added to the cart and actions for adding additional products to the cart.

hollys on April 25, 2012


Rules module can be a solution I had not thought of.
I just watched what he was proposing, and I don't think what I want to do is possible. It would therefore probably use php ..

I thought of a cleaner solution, overloading the Add to cart?
Do you think this is possible?