How to add two products in one click In my Drupal Commerce site, I have a product type - an attribute which refers to another product type (via reference product).

The display is:

Type 1

Product 1-1 x

Product 1-2 x

Product 1-3 x

Add to Cart

Type 2

Product 2-1 x

Product 2-2 x

x produces 2-3

Add to Cart

I would like only one "add  to cart" button to be visible, and that clicking it should add  two products which were selected at the same time.

How can this be accomplished?
I would do this with rules:

Event

After adding a product to the cart

Action

Add a product to the cart


Parameter: User: [site:current-user], 
Product SKU: [other product
sku] Provides variables: Added product line item
(product_add_line_item)