Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Add to cart button does nothing: how to find and fix it

CNV-136High impactDetectedBy FunnelGuardPublished Updated
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.

Where the purchase path breaks
  1. Ad or search clickVisitor lands on product page
  2. Clicks Add to cartNothing happens
  3. CartNever reached
  4. CheckoutNever reached
  5. PurchaseNo order, no conversion tracked

The click is the break. Everything after it never happens.

A click that goes nowhere

The button looks fine, but the click never reaches it or the cart request fails.

How to check if your site has it

Reproduce the problem
  1. Open the product page in a private window

    This removes extensions and cached scripts. Note the product URL and the variant you choose.

  2. Open DevTools

    Press F12 (or Cmd+Option+I on Mac). Go to the Console tab and clear it.

  3. Click Add to cart

    Watch the Console for red errors, such as 'Uncaught TypeError', and check whether the cart count changes.

  4. 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.

  5. 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 each symptom usually points to
What you seeLikely cause
Red error in Console on clickA broken or conflicting script (theme, app, plugin)
No request in Network tabClick handler not attached, or button covered by another element
Request returns 4xx/5xxVariant unavailable, out of stock, session or server problem
Request succeeds but count stays 0Cart drawer or count not refreshing, or caching
Page reloads with no item addedForm 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.

Fix by platform
  1. Preview with apps off

    Duplicate your theme, disable recently added apps or remove their code from theme.liquid, and test the button.

  2. 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.

  3. 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.

Log a failing cart request (Shopify example)javascript
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';
});
What a broken button can do to ordersExample numbers
What a broken button can do to orders (example)Button working: 30 orders per week; Button broken on mobile only: 15 orders per week; Button broken everywhere: 0 orders per week0122330150Button workingButton broken on mobi…Button broken everywh…orders per week

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

Fix confirmation
  • 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

Habits that catch it early
  • 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: click + cart count assert.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.