Start with the product
Most failures are configuration, not code.
If the product fails any of these, the button is behaving correctly and the fix is in Shopify. See Product shows sold out.
Then isolate the cause
1
Compare editor and live preview
Test the same product in the theme editor preview and on the live storefront. A failure in only one points at the editor rather than at your setup.
2
Test in incognito
Open a private window with no extensions. Browser extensions, especially ad and script blockers, break add to cart regularly.
3
Test another device
Try a phone as well as desktop. A failure on only one points at a layout or script problem specific to that breakpoint.
4
Test a clean theme copy
Duplicate the theme, remove your custom code from the copy, and test the same product. If the clean copy works, your custom code is the cause.
5
Test with apps disabled
Disable one suspect app at a time in the test copy and retest. See App conflicts.
6
Capture the console
If it still fails, open the browser console and reproduce the failure. The error text is the fastest route to a fix.
Symptoms and likely causes
It works on the live store but not in the theme editor preview
It works on the live store but not in the theme editor preview
A known Shopify theme editor behaviour, usually down to Markets. The editor previews a country
the product is not available in, so the button cannot add. Use the country selector at the top
of the theme editor to switch to a country the product does sell in, then try again. If it adds
there, nothing is wrong with your theme or your product.
It redirects to the homepage
It redirects to the homepage
Typically an older theme version conflicting with a newer Shopify or app behavior. Update the theme on a duplicate, see Updating safely.
The wrong variant is added
The wrong variant is added
Check that each image is assigned to the intended variant in Shopify, and that variant names match what the theme expects. A subscription, bundle, or product-option app can also rewrite the line item.
It works on desktop but not mobile
It works on desktop but not mobile
Check for an element overlapping the button on small screens, such as a sticky bar or a cookie banner. Test with the sticky add to cart both on and off.
It only fails for some products
It only fails for some products
That points squarely at product configuration rather than the theme. Compare a working product against a failing one field by field.
A free gift or bundle is involved
A free gift or bundle is involved
Promotion rules can block a line item. Test with a simple cart containing only the qualifying product. See Free gifts and Upsells.
If it is still not resolved
- The product and variant URL
- Your theme version
- Browser, device, and operating system
- The list of cart, upsell, subscription, and product-option apps installed
- A screenshot of the browser console error
