How can I trigger an event before adding a product to the cart?

Shopify Partner
2 0 0

HI guys,

I'm looking to build a feature that fires JUST before the user adds a product to the cart somewhat like CandyRack:

I'm wondering how candy rack captures the add to cart event and then sends out the exact same event after closing out their window. I would like this exact behaviour.

The behaviour I'm talking about is that:
After you've installed the Candy rack app and created an offer.
When a user goes to the product page and clicks ADD TO CART. 

Nothing is added to the cart YET.
FIRST CandyRack opens and AFTER you either made a selection or clicked the close button THEN the add to cart event is fired.

Any ideas on how to do this?

All help is appreciated.

Reply 1 (1)

Shopify Partner
4 0 5

Hey could you find any solution or figure out a way how they do it?