Written by Sanjoy BiswasFounder, Infosoftix · 20 years in software, 2,000+ projects
Updated
When the Add to Cart button stops working, a WooCommerce store stops selling, and it's often invisible to the owner, who is logged in and sees a different version of the site. The symptom varies: the button does nothing, the spinner never stops, the product appears in the cart and then vanishes, or the mini-cart doesn't update until the page is reloaded. Each symptom points to a different cause, so start by writing down exactly what happens, on which page, and for which products.

How Add to Cart works
On shop and category pages, WooCommerce can add products without a page reload. The button sends a background request to the wc-ajax=add_to_cart endpoint, the server adds the item to the shopper's session, and WooCommerce returns updated cart fragments, the small pieces of HTML such as the mini-cart and the cart count. On single product pages, the button usually submits a normal form and the page reloads. Anything that breaks the background request, the session cookie or the fragments breaks the button.
Cause 1: The AJAX settings
In WooCommerce → Settings → Products, two options control the behaviour: Enable AJAX add to cart buttons on archives and Redirect to the cart page after successful addition. If a theme expects one and the setting says the other, the button can appear to do nothing. Variable products always need the shopper to choose options on the product page first, so their archive button says "Select options" instead.
Cause 2: Caching the cart
This is the most common cause of a cart that empties itself. Full-page caching, at the host, in a plugin or at a CDN, must never cache the cart, checkout and My account pages, and must not cache pages for visitors who have WooCommerce's cart cookies (woocommerce_items_in_cart, woocommerce_cart_hash and the session cookie). If cached pages are served to shoppers with a cart, they see someone else's empty cart. Most WooCommerce-aware cache plugins handle this, but custom CDN rules often don't.
Cause 3: A JavaScript error
One broken script can stop every script after it, including WooCommerce's. Open the browser's developer tools, go to the Console tab, reload the page and click the button. A red error naming a plugin or theme file is a strong lead. Script optimisation plugins that combine, defer or delay JavaScript are frequent culprits: exclude WooCommerce's scripts and jQuery from delay, then test again.

Cause 4: Theme template overrides
Themes can override WooCommerce templates such as the add-to-cart buttons. When WooCommerce updates and the theme's copy doesn't, the button can lose the attributes the scripts rely on. WooCommerce → Status lists outdated template overrides at the bottom of the report. Switching briefly to a default theme such as Storefront on a staging copy confirms whether the theme is involved.
Cause 5: Product setup
Some "broken" buttons are working as designed. A product with no price can't be purchased, so no button appears. An out-of-stock product, a variation that wasn't selected, a sold-individually product already in the cart, or a minimum or maximum quantity rule from a plugin will all block the add, usually with a notice at the top of the page that a theme may hide.
Cause 6: Security rules blocking the request
Firewall plugins, host security rules and CDN bot protection can block the background request to wc-ajax, especially for visitors from some countries or with unusual browsers. In the browser's Network tab, a blocked request shows a 403 status. Check your firewall logs around the time of a test click and allowlist the WooCommerce endpoint rather than turning protection off.
Block-based cart and checkout
Newer stores use the Cart and Checkout blocks, which rely on the Store API instead of the older endpoints. Plugins built only for the older shortcode cart may not work with the blocks. If problems started after switching, check each plugin's compatibility, or temporarily switch the cart page back to the classic shortcode to compare.
How to test it properly
- Log out, or use a private window: logged-in admins usually skip the cache.
- Test a simple product and a variable product, from both the shop page and the product page.
- Watch the Console and Network tabs while clicking.
- Repeat on a phone over mobile data, because CDN and firewall rules can treat it differently.
Example: the cart that emptied itself
Example, for illustration. A store adds a CDN with full-page caching to speed up the site. Shoppers can add products, but the cart is empty when they open it, and sales drop. The CDN cached the cart page and ignored WooCommerce's cookies. Adding bypass rules for the cart, checkout and My account pages, and for visitors with cart cookies, fixes it without losing the speed gain on other pages.
What to have ready before you contact us
- What happens when you click, on which pages, and since when.
- Recent changes: plugin updates, a new theme, cache or CDN settings.
- A staging copy of the site, if you have one.
- Admin access through a separate user account for us. Never share your own password.
Get it fixed
We fix WooCommerce cart and checkout problems as hourly custom development, $25–$49 per hour depending on the work; most Add to Cart fixes take a few hours. We find the cause on a staging copy, fix it, test on desktop and mobile, and explain what changed. If the button works but checkout is slow, see why WooCommerce checkout is slow. Book a call.