I need an app or code for conditional logic so Product A must be in the cart to purchase Product B.

I need an app or code for conditional logic so Product A must be in the cart to purchase Product B.

Shackletons
Visitor
1 0 1

Hi,

 

I need an app or code help for conditional logic so Product A must be in the cart to purchase Product B.

 

My store has one main product (A). I also sell one accessory (B). 

 

You can buy the main product (A) on its own.

BUT

You can only buy the accessory (B) if you buy the main product (A).

 

Obviously I want to inform customers of this when they try to add the accessory to an empty cart. 

 

I don't think a bundle is the right solution because you can buy an unlimited amount of the accessory if you buy any variant of the main product.

 

For reference my store is https://ShackletonsSecret.com. It uses Dawn 15.2.0.

 

If this can be handled with the free version of an app, that would be ideal. I looked at Easify but if I have to pay $10 or $20 per month, then I'd rather just edit the code once and be done with it.

 

Thanks in advance for your assistance. 

Replies 3 (3)

Jivan_Suhagiya
Shopify Partner
602 83 129

Hi @Shackletons ,
So you want to apply logic on cart page or on product page to don't allow add to cart if cart is empty?

If helpful then please Like and Accept Solution.
Email: suhagiyajivan1992@gmail.com
Skype: jivan.suhagiya
First kind of Checkout Reminder APP: https://apps.shopify.com/checkout-reminder

Ellie-BOGOS
Navigator
259 18 33

Hi @Shackletons!

 

I'm Ellie from BOGOS: Free gifts, Discounts & Bundles. You can easily set up this product rule using BOGOS's Buy X get Y feature.

The app can help you create a conditional purchasing rule where Product B (accessory) is only available when Product A (main product) is in the cart.

 

This is actually a common scenario for many stores. You can hide Product B from normal purchase, and customers may see a slider offering product B at full price or at a discount when they meet the condition, like this.

 

EllieBOGOS_0-1736739189111.png

 

What makes this solution particularly powerful is that BOGOS will:

  • Optimize for your store's conversion rate
  • Automatically show/hide the accessory's availability based on cart contents
  • Display clear messages to customers about purchase requirements
  • Handle all the conditional logic without any code changes
  • Allow you to modify rules anytime through the admin panel

Within the same app, you can also expand to use other promotional features, such as free gift with purchase, BOGOS, bundles, quantity breaks or discounts. We also offer you a 24/5 Live chat support and are ready to assist you with any advanced customization you want 😁

 

Install BOGOS to try (4.9 overall rating, 2400+ reviews).

If it is helpful, let me know by giving a Like or Accept solution.
Use BOGOS.io Free gift to create special promotions: BOGO, gift with purchase, product bundles, quantity breaks on your store!
Have a nice day ^_^

bundler-marko
Pathfinder
116 10 22

Hi,

 

You can try using the CartBot app. It allows you to automatically add a product to the cart, if a trigger product is added by the customer. You could configure the bot to add product B, if a customer adds product A to the cart. You could also hide product B from all of your collections, so customers won't find it by themselves. Lastly, if you tick the option "bot works in reverse, customers shouldn't be able to add more then one product B and if they remove product A from the cart, product B should get removed as well 🙂

Bundler combines perfection with non-negotiable value and total creative control. Learn more