Shopify Add-to-Cart Button Not Working? 5-Minute Fix Guide
A broken mobile Add-to-Cart button still returns 200 OK to generic uptime pingers—so Meta and Google ads keep burning cash until revenue drops. Here are the 4 most common causes and how to catch them before customers do.
1. Check DevTools Network for POST /cart/add.js → 422
Open Chrome DevTools in mobile emulation (390×844), click Add to Cart, and filter Network by cart/add. An HTTP 422 response means either the hidden input[name="id"] wasn't updated when a shopper switched variants, or a bundle/upsell script injected a sold-out variant ID.
2. Inspect Console for third-party app TypeError crashes
Shopify Dawn and OS 2.0 themes rely on product-form.js and cart-drawer.js. When an upsell, subscription, or sticky-cart app throws an uncaught TypeError on submit (such as Cannot read properties of null (reading 'openDrawer')), the cart drawer freezes even though the button looks clickable.
3. Verify /cart.js actually incremented item_count
Even if a spinner stops without visible errors, open yourstore.com/cart.js in a new tab right after clicking Add to Cart. If item_count is still 0, the form event listener was intercepted or failed CORS/CSRF checks.
4. Test real mobile & desktop checkouts automatically after every change
- Runs externally in real headless Chromium (390×844 mobile & 1280×800 desktop) with zero JS added to your theme.
- Verifies product load, variant switch, Add to Cart,
/cart.js, and Checkout handoff—stopping before payment. - 30-second auto-retry eliminates false alarms before sending JS console errors, HTTP 4xx/5xx traces, and a full-page PNG to Slack, Discord, or Email.