Apps that change the cart
How an app can tell the theme that the cart changed, so the cart count, drawer and cart page refresh.
What to do
Section titled “What to do”An app that adds to the cart with Shopify’s Ajax API sends this event after its change:
document.dispatchEvent(new CustomEvent('cart:refresh'))Good to know
Section titled “Good to know”- The theme itself sends
cart:changeafter each of its own cart changes. - To add an app’s own block to the cart page, use Add block → Apps in the Cart section. See App blocks and app embeds.