WooCommerce fixes / add to cart not working

WooCommerce Add to Cart Not Working? Causes & Fix

The button spins forever, does nothing at all, or the cart count never moves. In most cases the wc-ajax=add_to_cart request never completes — something is blocking the endpoint, or a JavaScript error stopped the button ever being wired up. Here's how to tell which, without guessing.

Last updated: 16 Jul 2026 · ~7 min read

Quick answer

The most common cause is that the add-to-cart AJAX request never completes — a cache, firewall or security layer intercepts the wc-ajax=add_to_cart endpoint, or a JavaScript error stops the handler binding to the button. Open your browser's network tab, click the button, and watch for the wc-ajax request. No request at all means JavaScript; a request returning anything but a clean 200 means it's being blocked.

What the button is actually trying to do

On shop and category pages, WooCommerce's add-to-cart button doesn't reload the page. It fires an AJAX request to a wc-ajax endpoint, gets back the updated cart fragments, and updates the cart count in place. On a single product page it usually submits the form normally, unless your theme has AJAXified it too.

That's why this failure has exactly two shapes. Either the request goes out and something in front of WordPress interferes with it — a page cache, a WAF, a security plugin, a CDN — or the request never goes out at all, because the JavaScript that would have sent it died first. The browser's network tab separates those two worlds in one click, and everything below follows from which side you land on.

The most common causes (most likely first)

  1. A JavaScript error stops the handler bindingYou click and nothing happens — no spinner, no request in the network tab. Open the console: an error from the theme or another plugin fired before WooCommerce's script ran, so the button is just a link with no listener.
  2. A cache or CDN is serving stale cart stateThe request succeeds, but the cart count doesn't move — or it works for you (logged in, cache bypassed) and fails for customers. A full-page cache serving cart fragments, or stripping WooCommerce's cart cookies, produces exactly this.
  3. A firewall or security layer is blocking the endpointThe wc-ajax request appears in the network tab and comes back 403, 503, or a block page instead of JSON. A WAF, ModSecurity rule, bot protection or rate limiter is refusing the request.
  4. The product isn't purchasableThe button doesn't exist, or reads Read more rather than Add to cart. A simple product with an empty price field is not purchasable in WooCommerce and won't render a working button — check the product's price field before blaming JavaScript.
  5. It's a variable product with no variation selectedThe button is greyed out or refuses until every attribute dropdown is chosen — and if a combination has no matching variation, or that variation is out of stock, it stays disabled. Behaving correctly; the product data is what's wrong.
  6. The nonce is stale, so the request is rejectedIt works on a fresh page load and fails after the page has been sitting open, or fails only on cached pages. The security token baked into the page has expired or was cached from someone else's session. A custom theme template or quick-view widget that rebuilds the button can produce the same thing.

Where to look first

Every minute this is broken, nobody can buy anything.

Add to cart failing is the most expensive kind of quiet — no error in your admin, no failed orders to look at, just a shop that stopped converting. And you often can't reproduce it, because you're logged in and cached out of the bug. DiagnosticIQ's free dashboard checks the path from product page to paid order, and Checkout Guard exists so that a store which has stopped taking carts is something you find out about the same hour, not from a week of flat sales.

Get the free plugin

Made by Prima Digital — the team behind this guide. Free forever; no card to install.

How to know you fixed it

Verify

In a private window, logged out, clicking Add to cart fires a wc-ajax=add_to_cart request that returns 200, the cart count increments without a page reload, and the product is still there when you open the cart page.

Frequently asked

It works for me but not for customers. Why?

Almost certainly caching. Logged-in admins usually bypass the page cache entirely, so you're testing a different site to the one your customers see. Reproduce it in a private window, logged out, before anything else.

Should I just disable my caching plugin?

Purge it first and retest — that's often enough. If disabling it fixes the problem, don't leave it off: the real fix is excluding the cart, checkout and my-account pages, and the wc-ajax endpoint, from being cached.

The button is greyed out on a variable product. Is that a bug?

No. WooCommerce disables it until every attribute is selected and resolves to a real, in-stock variation. If a combination customers expect is unselectable, the variation is missing or out of stock — that's a product data problem, not a button problem.

Am I losing orders while this is broken?

Yes, and invisibly — a customer who can't add to cart never becomes an order, so there's nothing in your admin to count. Flat sales with normal traffic is the only signal you get.

>_
John O'Keane — Founder, Prima Digital · LinkedIn
Contributions by David Zhang · LinkedIn
I build DiagnosticIQ, the WooCommerce diagnostic plugin, and a dead Add to cart button is the failure I most often find owners couldn't reproduce because they were logged in the whole time.