How to silently add a product to cart when another product is added

JoeJErnst
New Member
1 0 0

My store will have products that have "required", or "dependent" products, so to speak.  Let's jump right into an example:

Let's say I have Products A and B, which are electrical components that require a certain length of wire in two colors.  The wire is also sold as its own products, lets say REDWIRE and BLACKWIRE, both sold by the foot.

Products A and B each have two variants, which specify the length of wire required.  So A.1 requires 1 ft. of REDWIRE and 1 ft. of BLACKWIRE, while A.2 requires 2 ft. of each wire.  Same for B.1 and B.2

How can I make the shopping experience such that a customer selects the product and variant, and the proper amount of REDWIRE and BLACKWIRE is automatically added to the cart?  In the end, there should only one line item for each wire, with the quantity being the sum of lengths required by the A and B products, as well as any REDWIRE or BLACKWIRE that was selected as its own product (by the foot).  When A and B product quantities are increased or decreased, the overall quantity of the required wires should also increase or decrease.

I have been looking at product bundler apps, but I don't want the customer experience to be that way; I want the wire quantities added silently to the cart in the background, if possible.

0 Likes
achieveapplabs
Shopify Partner
497 39 78

Hi there,

AJAX API + JavaScript is how you would 'silently' add a product to cart. The logic could be pre-configured by you in an app, or it could be static code within your theme. 

It's a tough find in the app store and pretty specific functionality, on the bright side you have a good description of what you're looking for. 

Best regards,
Achieve Team

Use Approovly to create and track order approvals | Looking for more Shopify apps? achieveapplabs.com/#apps
0 Likes