Is there a theme agnostic way to open cart drawer?

Is there a theme agnostic way to open cart drawer?

jmattiace
Shopify Partner
9 0 2

I have a theme extension app that allows users to add products to the cart via the AJAX API. How can I open the cart drawer across all themes after successful AJAX call? 

Replies 3 (3)
jmattiace
Shopify Partner
9 0 2

@Talok_klot thank you for the detailed response! However, I should have clarified that I am the developer of the theme extension app which gets embedded on any number of Shopify themes, so I am looking for a way to do this without having to have knowledge of any theme-specific cart behavior.

Tomnaor
Shopify Partner
4 0 1

Did you find any solution for that? @jmattiace 

Satendra
Shopify Partner
4 0 0

You can use the jQuery code to open the Cart Drawer.

$('cart-drawer').addClass('active');