On this page
What this issue is
The shopper is on a product page and clicks Add to cart. The button may look normal, but the cart count stays the same, no drawer opens and no message appears. Sometimes the button spins forever or the page just reloads.
Behind the button, most stores send a small request to the cart (often called an AJAX request, meaning the page talks to the server without reloading). If the script that sends it breaks, or the server rejects it, the click goes nowhere.
Why it costs you leads or sales
Add to cart is the step between interest and checkout. If it fails, every visitor who wanted the product is stopped, including the ones you paid to bring in from ads. Most will not retry or tell you. They simply leave.
The failure is also easy to miss. Pages load, analytics look normal and orders from other products may still come in. Often only one product, one variant, one browser or mobile shows the fault.
- Ad or search clickVisitor lands on product page
- Clicks Add to cartNothing happens
- CartNever reached
- CheckoutNever reached
- PurchaseNo order, no conversion tracked
The click is the break. Everything after it never happens.
The button looks fine, but the click never reaches it or the cart request fails.
How to check if your site has it
Open the product page in a private window
This removes extensions and cached scripts. Note the product URL and the variant you choose.
Open DevTools
Press F12 (or Cmd+Option+I on Mac). Go to the Console tab and clear it.
Click Add to cart
Watch the Console for red errors, such as 'Uncaught TypeError', and check whether the cart count changes.
Check the Network tab
Filter by Fetch/XHR. Look for the cart request (for example /cart/add.js on Shopify, ?wc-ajax=add_to_cart on WooCommerce). A 4xx or 5xx status, or no request at all, tells you where it fails.
Repeat on mobile and with other variants
Test a phone-sized view, a second browser and at least two products or variants. Faults are often limited to one of these.
| What you see | Likely cause |
|---|---|
| Red error in Console on click | A broken or conflicting script (theme, app, plugin) |
| No request in Network tab | Click handler not attached, or button covered by another element |
| Request returns 4xx/5xx | Variant unavailable, out of stock, session or server problem |
| Request succeeds but count stays 0 | Cart drawer or count not refreshing, or caching |
| Page reloads with no item added | Form posts to the wrong place or variant ID missing |
How to fix it
Start with the most recent change: a new app, plugin, theme update or tracking script. Disable it and test again. If the button works, you have found the culprit.
Preview with apps off
Duplicate your theme, disable recently added apps or remove their code from theme.liquid, and test the button.
Check the variant ID
The product form must submit a hidden input named id with a valid variant. Make sure the form still contains it after theme edits.
Check inventory and selling settings
In Products, confirm the variant has stock or 'Continue selling when out of stock' is on if you want it sellable.
Find the conflict
In WooCommerce, switch temporarily to a default theme such as Twenty Twenty-Four and deactivate plugins one by one, testing after each.
Check AJAX add to cart
Under WooCommerce > Settings > Products, review 'Enable AJAX add to cart buttons on archives'. Clear any caching plugin and exclude cart, checkout and my-account pages.
Check required options
Variable products need all attributes chosen. Confirm every variation has a price and stock status set.
Use Preview mode
Open Tag Assistant for your container and click Add to cart. Look for custom HTML tags or click listeners that call preventDefault or throw errors.
Pause suspect tags
Pause recent custom HTML tags, then test the button before republishing.
Check the Ecommerce settings
Make sure the product is active, has a published SKU and the Add to Cart element is bound to the product.
Remove custom code
Temporarily remove custom scripts from Project settings > Custom code and page settings, then publish and test.
Review the product settings
In the Wix Stores product, check that required options are available and stock is set. Remove any custom code added through Velo or Custom Code that touches the button.
Check code injection
Under Settings > Advanced > Code Injection, remove recent scripts and test. Confirm the product is not set to a state with no stock for the chosen variant.
Check the handler
Confirm the click listener attaches after the DOM loads and that no overlay sits above the button. Log errors from the cart request.
Handle failures visibly
Show an error message when the cart request fails, so shoppers know to retry.
document.querySelector('form[action*="/cart/add"]').addEventListener('submit', async (e) => {
e.preventDefault();
const res = await fetch('/cart/add.js', { method: 'POST', body: new FormData(e.target) });
if (!res.ok) {
console.error('Add to cart failed', res.status, await res.text());
alert('Sorry, we could not add this item. Please try again.');
return;
}
window.location.href = '/cart';
});Example: 1,000 product page visits a week at a 3% add-to-cart-to-order rate. Numbers are illustrative.
How to confirm it's fixed
- Clicking Add to cart adds the item and the cart count goes up by one
- The Console shows no new red errors on click
- The cart request returns a 200 status in the Network tab
- Every variant you sell can be added, not just the default
- It works on mobile, desktop and at least two browsers
- The item appears in the cart with the right price and quantity
How to prevent it happening again
- Test Add to cart on a staging theme before publishing theme, app or plugin changes
- Re-test after adding any tracking, chat or popup script
- Test your top-selling products and one with variants after each update
- Keep a short list of products to check after every release
- Run an automated check on a schedule so you do not rely on customers to report it
How FunnelGuard handles this
FunnelGuard detects this issue today. A robot visitor opens your product page on a schedule, clicks Add to cart and checks that the cart count goes up. If it does not, the check fails.
A failure is re-checked from a second region before one alert goes out (email, Slack, Teams, WhatsApp, webhook or PagerDuty), with a screenshot and a likely cause. The robot stops before payment unless your store's test mode is set up, and it never bypasses CAPTCHAs or bot protection. The Free plan covers 1 site and 2 journeys with daily checks, no card needed.
Questions people ask
Why is my add to cart button not working?
The most common causes are a JavaScript error from a theme, app or plugin, an unselected or unavailable variant, a failed cart request, or another element covering the button. Open the browser Console and Network tab, click the button and see which one applies.
Why does my add to cart button do nothing on mobile only?
Mobile faults are usually caused by a sticky bar, cookie banner or chat widget covering the button, or by a script that only runs on a desktop layout. Inspect the button in a phone-sized view and check which element receives the tap.
How do I test if add to cart is working?
Open the product page in a private window, click Add to cart and check that the cart count rises and the item shows in the cart. Also watch the Console for errors and the Network tab for a successful cart request. Repeat with each variant.
Why does add to cart work for some products but not others?
The affected products may be out of stock, have missing variants or prices, or use a different template. Compare a working product with a broken one for stock, variant settings and any custom code.
Can a tracking script or popup break add to cart?
Yes. A custom script can throw an error that stops other code from running, or an overlay can intercept the click. Pause recent tags or apps and test again to confirm.
Why does the cart stay empty after clicking add to cart?
Either the cart request failed, or it worked but the cart count and drawer did not refresh. Check the Network tab for a failed request, and clear page caching if the cart is cached for all visitors.
How can I monitor add to cart automatically?
FunnelGuard runs a robot visitor on a schedule that clicks Add to cart and checks that the cart count increases. If it fails, it re-checks from a second region and sends one alert with a screenshot and a likely cause.
Related issues
- CNV-135Add to cart button missingFix guide
- CNV-137Variant selector (size/colour) doesn't change price or imageFix guide
- CNV-138Variant combination unavailable but still sellableFix guide
- CNV-140Product shows in stock but checkout says unavailableFix guide
- CNV-141Price on page differs from cart/checkoutFix guide
- CNV-150Buy Now/express button skips variant choiceFix guide