Shopify Add to Cart Button Not Working: Causes & Fixes (2025)
Shopify Add to Cart Button Not Working: Causes & Fixes (2025)
Keywords: Shopify add to cart not working, Shopify cart button issue, Shopify product page not adding to cart, fix cart button Shopify
Introduction
The "Add to Cart" button is one of the most critical features on your Shopify store. If it stops working, your sales come to a halt. In this guide, we’ll look at the top reasons this button might fail and how to fix it quickly.
Common Reasons Add to Cart Button Isn't Working
🔧 1. Theme or Code Conflict
-
Custom JavaScript, app scripts, or manual code edits may be interfering.
📦 2. Variant Selection Required
-
Product has multiple variants (e.g., size or color) and one is not selected.
🚫 3. Product is Out of Stock
-
Inventory is set to "Continue selling when out of stock" disabled.
🔒 4. Store is in Preview or Password-Protected Mode
-
In some themes, interactive buttons may not function fully while password protection is enabled.
⚙️ 5. JavaScript Errors on the Page
-
Theme errors can stop JS from running, which is needed for the cart functionality.
How to Fix the Add to Cart Button
✅ 1. Test in Safe Mode
-
Use the default theme (like Dawn) to check if the issue persists
-
If it works, the problem is in your active theme’s code
✅ 2. Inspect Variant Selection
-
Go to Products > Product Name
-
Ensure each product variant has stock
-
Make sure the default option is selected or prompt user to choose one
✅ 3. Check Inventory Settings
-
From product page, ensure inventory tracking is accurate
-
Toggle on "Continue selling when out of stock" if appropriate
✅ 4. Debug with Chrome DevTools
-
Right-click > Inspect > Console
-
Look for JavaScript errors like
Uncaught TypeError
ornull
values -
These often point to issues in
theme.js
or third-party scripts
✅ 5. Disable Problematic Apps Temporarily
-
Apps that customize product pages or handle carts may clash with theme code
-
Disable them one by one and test the Add to Cart button
Advanced Troubleshooting
🛠 Use event.preventDefault()
Carefully
If custom JavaScript has this function, it might block the form submission.
🛠 Ensure Correct Button Class
Shopify uses product-form
and AddToCart
class selectors. Make sure these are intact in your theme:
<form method="post" action="/cart/add">
<input type="hidden" name="id" value="{{ product.variants.first.id }}">
<button type="submit">Add to Cart</button>
</form>
🛠 Revert to Backup Theme
If all else fails, publish an older working version of your theme from backups.
Prevention Tips
-
Always back up your theme before editing code
-
Test new apps on a duplicate theme
-
Monitor cart events using Google Tag Manager or GA4
Conclusion
If your Shopify Add to Cart button isn’t working, it’s not just a bug—it’s a blocker to your revenue. Most issues are caused by theme conflicts, missing variant selection, or JavaScript problems. Use this guide to diagnose and fix the issue fast so your customers can get back to shopping.