Shopify add to cart button not working: causes and fixes
When a Shopify add to cart button does nothing, a JavaScript error in the theme is the usual cause: an app script, a leftover snippet from an uninstalled app, or an edited theme file stops the product form from sending the selected variant. Less often the variant really is unavailable and the theme is correctly disabling the button. Open the browser console on the live product page, click the button, and the first red error tells you which.
What you'll see
A shopper picks a size or colour, taps Add to cart, and nothing happens. Sometimes the button stays greyed out after a variant is chosen, works only after a page refresh, or works on desktop but not on a phone. The Buy it now button may still work, which makes the problem easy to miss when you test it yourself.
Why it happens
1. A JavaScript error stops the product form
Shopify themes use a script to pass the chosen variant ID into the form. If an app injects code that throws an error, or a theme file such as product-form.js was edited, that script never finishes and the button has nothing to submit.
2. Leftover code from an app you uninstalled
Uninstalling an app does not always remove the script tag it added to theme.liquid. A tag pointing at a file that no longer exists throws an error, and every script after it on the page can fail with it.
3. The theme's cart script lives in a section that broke
Some themes load the AJAX cart code from the header or cart drawer section. Remove or break that section and the add to cart request is never sent, even though the button still looks normal.
4. The variant genuinely cannot be bought
If a variant is out of stock with "Continue selling when out of stock" turned off, or the product is not available on the Online Store sales channel, the theme disables the button on purpose. That is correct behaviour with a confusing look.
How to fix it
- Open the product on your live store in a private window, open DevTools (right-click, Inspect, Console), choose a variant and click Add to cart. Write down the first red error and the file name it mentions.
- Go to Online Store > Themes > Customize > App embeds and turn embeds off one at a time, retesting in the theme preview after each. The one that makes the button work again is the culprit.
- Duplicate your theme, then open Edit code > layout/theme.liquid in the copy and search for script tags that reference apps you no longer use. Remove them in the copy and preview it.
- In Products, open the product and check each variant: inventory quantity, the "Continue selling when out of stock" setting, and that the product is available on the Online Store sales channel.
- If the theme is heavily customised, add a fresh copy of the same theme from the Theme Store and preview the product there. If it works in the fresh copy, the bug is in your edits, not in Shopify.
- Publish the fixed theme and repeat the test on a real phone over mobile data. Slow connections expose a race where the button is tapped before the scripts behind it have loaded.
How to check it's fixed
- In a private window, select every variant in turn and click Add to cart. The cart count or drawer should update each time.
- Open /cart and confirm the right variant and price are there, then repeat the whole test at phone width.
- Reload the product page with the console open and confirm no red errors appear before you touch anything.
What a QAlaunch scan shows for this
- JavaScript errors in the console on the product page, with the file that threw them.
- Failed network requests for scripts or app files that no longer exist.
- A primary button that is visible but leads nowhere when clicked, on desktop or phone.
- It cannot see your inventory or sales channel settings, so a correctly disabled out-of-stock button shows up as a symptom to check, not as a bug.
See exactly what a full report contains in the sample report.
Frequently asked questions
Why does Buy it now work but Add to cart does not?
They use different code paths. Buy it now goes straight to checkout through Shopify’s own dynamic checkout button, while Add to cart relies on your theme’s scripts. A theme or app error breaks the second and leaves the first alone.
Can a Shopify app break my add to cart button?
Yes. Upsell, bundle, product option and print-on-demand apps all hook into the product form. An update to one of them, or a conflict between two, is one of the most common reasons the button stops working overnight.
Will switching themes fix it?
It will tell you where the problem is. If the button works in a fresh theme, the cause is your theme edits or an app that only targets your old theme. You do not need to switch permanently; fix the copy you already have.
How do I know how many sales I lost?
Compare product page views with add to cart events in Shopify Analytics for the days before and after the problem started. A sudden drop in the add to cart rate with steady traffic points to the button, not to demand.
Rather have a QA engineer test it by hand?
If this is a site you're launching or handing to a client, I'll go through it by hand, including the Shopify-specific issues a scan can't reach, like logged-in flows.
- Up to 10 key pages tested by hand, not a scan
- Every flow a customer uses: forms, sign-up, checkout, booking
- Real mobile and desktop browsers
- A written report in plain language, with screenshots
- A 15-minute call to walk you through it
- 10 years of professional QA experience
Tell me about your site and I'll reply personally, usually the same day.
No payment now. I'll confirm scope and price first.
Related fixes
More for Shopify: all Shopify fixes · Shopify testing · Shopify mobile checkout bugs
Written by Waqas Ahmad, QA engineer with 10 years of professional testing experience. Last checked October 26, 2026.
Sources: Shopify Community: add to cart button not working · Shopify Community: add to cart buttons not working