Open the cart drawer and update items in a theme app extension

Tomnaor
Shopify Partner
2 0 1

I have a theme app extension that allows users to add products to the cart via the AJAX API. How can I open the cart drawer with the updated cart items across all themes after successful AJAX call (I need a generic solution)? 

Reply 1 (1)

jam_chan
Shopify Partner
906 23 177

There is no generic solution. This is because the cart drawer is powered by different themes and apps. The only way is to integrate with the callback method of the cart drawer, e.g. trigger the cart drawer update after your app adds a product to the cart. Your best wish is the cart drawer can detect your Ajax API call automatically. But this is again not working most of the time.

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview