Make product buyable depending on other product in cart

5 0 1

Hello all you Shopify Gurus

Is there a way to prevent a customer of putting a product to the shopping cart if not a "depending" product already has been put to the cart first?

In detail:

We have "machines" and "accessories". All machines may be put to the shopping cart independently.

Some accessory products, though, should only be sold together with the machine it belongs to, so we want to prevent the user to put such an accessory product to the cart if not the belonging machine already is part of the cart.

Is there an "out of the box" functionality in Shopify to accomplish that?

Thanks a lot!