What interception does
Aftersell listens for the add-to-cart submit before the theme does. When it recognizes one, it:- Stops the event, so nothing else on the page handles that click.
- Sends the add to Shopify itself.
- Opens the Aftersell Cart drawer.
Why it exists
Without it, both carts respond to the same click. The theme adds the item and opens its own drawer, Aftersell adds it and opens ours, and the shopper sees two carts, often with the item added twice. Stopping the event is the simplest way to guarantee one add and one cart.What it costs
Stopping the event stops it for everyone, not just the theme. Any other code listening to that same add-to-cart stops running: your analytics, a tracking pixel, a subscription or bundle app, a script you added yourself. It fails quietly. Nothing appears in the browser console, and the add itself still works, so the usual symptom is a number that’s wrong rather than something visibly broken:add_to_cartevents missing from GA4, Meta, or TikTok- A subscription or bundle app that works on the product page but not through the cart
- Your own
addEventListeneron the form never firing
When Aftersell doesn’t intercept
Interception isn’t always on. Aftersell leaves add-to-cart alone when:- It recognizes your theme’s cart. On themes Aftersell knows how to work with, it makes the theme’s own cart inert instead of blocking the event, then lets the theme perform the add normally. Your scripts run as they always did. See Which themes below.
- The form doesn’t add a line item. A form with no variant
idand noitems[]is left alone. - You’ve opted out using one of the methods below.
Which themes Aftersell recognizes
Aftersell matches on how a theme is built, not on its name, so a custom theme forked from any of these is normally recognized too, including private builds Aftersell has never seen.
The reverse also happens: a heavily customized build can drift far enough from its parent that Aftersell no longer recognizes it, even though the theme is still called “Dawn”. Being on this list makes recognition likely, not certain.
Your options
Choose the narrowest one that solves your problem. Each row gives up more than the one above it.Before you choose: what changes
Opting out hands the add back to your theme, which raises two questions worth answering before you pick a row: whether your cart still opens, and whether the theme’s cart turns up next to it.Will your cart still open?
Usually yes, with no work on your part. Whoever performs the add, Aftersell watches for the request going to Shopify and opens the drawer when it sees one, following your normal Open cart when an item is added setting. You don’t have to call anything yourself. Three situations break that, and all three have a fix: The add goes somewhere other than Shopify’s cart endpoints. Aftersell watches/cart/add, /cart/change, /cart/update and /cart/clear on your own domain. An app that adds through its own endpoint and syncs the cart afterwards isn’t visible to this. Open the cart yourself once that app’s add finishes:
open_on_add_to_cart: 'never', nothing opens the drawer. That’s working as configured.
Will the theme’s cart open too?
This is the risk the opt-outs carry, and the answer depends on your theme. Making the theme’s cart inert is separate from interception and happens at page load either way, so none of the opt-outs here switch it back on. On a theme from the recognized list, the theme’s own cart stays quiet and the shopper sees one cart, yours. On a theme Aftersell doesn’t recognize, there’s nothing holding the theme’s cart back. Opting out means the theme handles the add exactly as it always did, including opening its own drawer or redirecting to/cart, while Aftersell opens its drawer from the request it saw. That’s two carts, and it’s the reason interception exists in the first place.
If that happens, you have three choices: leave interception on for that form, use a narrower opt-out that doesn’t cover the forms causing it, or stop the theme’s own cart yourself in your theme code.
This applies to add-to-cart only. Making the cart icon bypass Aftersell with the
aftersell-cart-wont-open-cart class is different: a cart-icon click sends no request, so there’s nothing for Aftersell to watch, and the drawer will not open. See below.Per form: a rule in code
The preferred option. Register a rule that returnstrue for the forms you want left alone:
true skips that form. Full details in Hooks.
Per form: a class in your theme
If you’d rather not write a rule, add theaftersell-cart-skip-atc class in your theme:
For a form submit, the class must be on the form element itself. A parent
div won’t work. For a button that adds to the cart without a form submit, the class can be on the button or any element around it.Whole store: turn interception off
The blunt option. Add-to-cart behaves exactly as your theme originally did, on every form:The cart icon is separate
The cart icon in your header is handled by its own interceptor, with its own opt-out. Turning off add-to-cart interception does not change what the cart icon does, and the reverse is also true. Clicking the cart icon opens the Aftersell drawer instead of going to/cart. To leave one icon or button alone, add the aftersell-cart-wont-open-cart class to it, or to any element around it:
/cart. Full details in Configure.
To change which elements open the cart rather than turning them off, use Cart settings → Advanced → Cart icon selector instead of editing your theme.
Where to go next
- Configure: every SDK option, including the ones referenced here.
- Hooks: per-form and per-line control.
- Open the drawer from a page builder: for Replo, PageFly, GemPages, and custom buttons that add to the cart their own way.