Learn how to enable the mini cart to automatically open when clicking the add to cart button
drawer-cart
or mini-cart
)drawer--visible
or similar)loadAjaxCart
function checks if the mini cart is currently visible by looking for the drawer--visible
classunloadAjaxCart
function handles the opposite case, checking when the mini cart should be closedonCartOperationComplete
is triggered:
theme:cart:init
event to initialize the carttheme:cart:reload
event to refresh cart contentsdispatchDrawerEvent