How to mimic theme behavior after manual call to /cart/add.js

Shopify Partner
17 0 6

Hi all,


I have a custom page from which I can add items to the cart via the AJAX API.

I want the visual response (example: cart icon & counter updated) to be exactly the same as if the user had added the item to the cart in PRODUCT page.

In other words, when adding an item to the cart from my custom page via the AJAX API, I want to mimic the behavior that the theme exhibits when adding an item to the cart from the PRODUCT page.

I'm guessing that there is a javascript function being executed when the product-add-to-cart-form is submitted but I have not been able to figure it out.

I'm currently using the "Dawn" theme in my test store.


Thanks for any assistance.

Replies 0 (0)