Shopify add to cart button not working after a theme or app change
By Michael Broadbridge. Last checked 14 November 2026 on Shopify admin, Dawn theme 16 and Horizon.
Short answer
When add to cart stops working after a theme or app change, the cause is usually a JavaScript error from an app or from code left by a removed app. Preview a fresh free Shopify theme such as Horizon or Dawn. If the button works there, the fault is in your theme or an app, not your products.
Symptoms
You may see this message:
Cannot find variant
- Clicking Add to cart does nothing, or the button spins and never finishes.
- The cart drawer or cart page opens but the product is not in it.
- The button shows Sold out even though the product has stock.
- It works on some products, or on a computer but not on a phone.
- It stopped straight after you installed, removed or updated an app, or changed theme.
Causes, most likely first
An app conflict
Bundle, upsell, subscription, product option and cart drawer apps often take over the button. Two of them doing this at once is a common cause.
Leftover code from an uninstalled app
Some apps add code to theme files that is not removed when the app is uninstalled. The code then calls files that no longer exist.
A theme JavaScript error
A small mistake in edited theme code can stop every script after it from running, including the add to cart button.
A new or updated theme
Updating a theme creates a new copy, and manual code edits usually do not carry over. If you publish a different theme, app embeds need switching on again in it.
Stock, status or publishing
A variant with no stock that is not set to keep selling shows Sold out. A variant unpublished from the Online Store channel is hidden, and the cart replies Cannot find variant if the theme still tries to add it.
How to fix it
If only one product is affected, check stock, status and publishing
- Open the product that will not add to the cart.Menu:
Products - Check that the status is Active and that Online Store is selected in the Publishing section.
- In the Variants section, check the Publishing column. A variant unpublished from Online Store is hidden from your store.
- Check the Inventory section for each variant. Stock needs to be at the location that fulfils online orders.
- If the quantity is zero, add stock or tick Continue selling when out of stock. That option only appears when Inventory tracked is on.
- If the product has more than 250 variants, older theme code may only see the first 250. Test one of the last variants in the list.
Test with a fresh, unmodified theme
A newly added theme has no custom code, and your apps’ embeds are not switched on in it. Previewing it does not change what customers see.
- Open your themes.Menu:
Online Store > Themes - In the Discover themes section near the bottom of the page, click Visit theme store. Choose a free Shopify theme such as Horizon or Dawn and click Add. It appears under Draft themes. Do not publish it.
- Click the three dot button next to the new theme and choose Preview.
- Open the same product in the preview and click Add to cart.
- If it works, the problem is in your live theme’s code or in an app embed. If it fails there too, look again at the product settings and your apps.
On the Starter plan, Spotlight is the only theme you can add, so use a duplicate of your theme for these tests.
Check the browser console for errors
The browser console lists errors on the page you are viewing. The file name in each error usually shows which app or file is responsible.
- Open the product page on your live store in Chrome on a computer.
- Right click anywhere on the page and choose Inspect, then click the Console tab.
- Reload the page and click the add to cart button.
- Look for lines in red and note the file name or web address at the end of each one.
- If the address contains an app’s name, that app is the likely cause. If it is a theme file, the theme code has an error. Errors saying a file could not be found, often shown as 404, usually point to leftover code from a removed app.
- If you see a 422 error from cart/add, open it. Cannot find variant means the variant is missing or not available on the Online Store channel. A sold out message means the variant has no stock to sell.
Switch off app embeds one at a time on a duplicate
- Click the three dot button on your live theme and choose Duplicate. The copy appears as Copy of followed by the theme name.Menu:
Online Store > Themes - Open the duplicate in the theme editor and click the App embeds icon on the sidebar.
- Switch off one app embed and save. Preview the duplicate and test the button.
- Repeat until the button works. The last embed you switched off is the one to raise with that app’s developer.
- Shopify’s own troubleshooting also suggests uninstalling a recently installed or updated app to test it. Read the app’s uninstall steps first, because some apps leave code in the theme.
Testing on the duplicate keeps every app working for customers while you look for the cause.
Roll back a recent code edit
- If the button broke after someone edited the theme code, click the three dot button on the duplicate theme and choose Edit code.
- Open the file that was changed and copy its contents somewhere safe, because restoring replaces the whole file.
- In the Timeline view, click an earlier entry to compare it with the current version.
- Right click the entry, choose Restore contents, then click Restore.
- Preview the duplicate and test the button again.
Timeline history is limited, files in the Assets folder have none, and deleted files cannot be recovered.
If that didn’t work
Variant selection
Some themes will not add to the cart until the customer has picked every option, such as size and colour. Check whether a variant is selected when the page loads.
The button is missing or invisible
Shopify’s theme troubleshooting notes that a missing Add to cart button can be a colour problem. Check that the Buttons colours in your theme settings are different and contrasting.
Code left in theme files
If no app embed is to blame, search all theme files for the names of apps you have removed. See the guide to removing leftover app code.
How to stop it happening again
- Duplicate your theme before installing an app that changes the product page or cart.
- Before uninstalling an app, check its uninstall steps and ask the developer whether it leaves code behind.
- Avoid running two apps that do the same job, such as two cart drawers.
- After a theme update, test add to cart on the new version before you publish it.
When to get help
If the fresh theme test shows the fault is in your theme and the console points to a theme file, not an app, the fix means editing theme code, and a mistake there can break the whole product page. That is a sensible point to stop, especially if the store is losing orders while you test.
What a developer would check
- The console errors and which script fails first.
- Theme files for code left by removed apps.
- The product form and cart code in the theme, against a clean copy of the same theme version.
- Whether two apps are both changing the add to cart button.
Describe the problem in your own words and WebFixed gives you an instant fixed quote. Nothing is charged until you accept it.
Related questions
- Why does the button say Sold out when I have stock?
- The stock is probably held at a location that does not fulfil online orders, or the selected variant has none available even though other variants do.
- Will previewing a different theme affect my live store?
- No. A preview is only visible to you, and customers keep seeing your published theme until you publish another one.
- Can Shopify support fix a broken add to cart button?
- Shopify support can check your product and inventory settings and confirm whether the platform is working normally. They do not debug custom theme code or third party apps.
Written by Michael Broadbridge, Founder of Webgro. First published 21 September 2026. Last checked 14 November 2026 on Shopify admin, Dawn theme 16 and Horizon.