WooCommerce Errors
WooCommerce Add to Cart Not Working
Last reviewed
Direct answer
Add to cart usually fails because of a JavaScript conflict, cached product HTML with expired nonces, blocked WooCommerce AJAX, cookie/session problems, or a theme/builder template that never posts a valid add-to-cart request—clear caches and exclude shop/cart pages, inspect the console Network tab, then conflict-test before rewriting the theme.
When the Add to cart button does nothing, spins forever, or the cart stays empty, shoppers never reach checkout—so revenue dies one product page at a time. This guide separates AJAX/front-end failures from stock, catalog, and session issues so you fix the layer that actually broke. Live stores that cannot sell should stabilize with Request Rescue, then keep cart/checkout healthy under Commerce Systems instead of endless plugin toggles mid-sale.
Key facts
Verifiable numbers and definitions — each claim links to its source.
- WooCommerce uses JavaScript/AJAX for add-to-cart on shop pages — one JS error can stop the button from working. (Troubleshoot JavaScript errors)
- WooCommerce requires Cart, Checkout, and My Account pages to stay uncached because they are customer-specific. (Configuring caching plugins)
- Conflict testing (default theme + WooCommerce only) is the documented way to isolate a plugin or theme breaking cart JS. (How to test for conflicts)
What the error means
“Add to cart not working” covers the path from the product (or shop loop) button through WooCommerce’s cart session and into a cart that actually contains the item. Simple products may use a full form POST or AJAX (`/?wc-ajax=add_to_cart` / `admin-ajax.php`); variable products need a chosen variation before the request is valid. WooCommerce relies on cookies/sessions, uncached nonces on interactive pages, and clean JSON from those AJAX calls. A theme that replaces the add-to-cart form, a cache that serves stale HTML, a script error that aborts jQuery, or a WAF that blocks the AJAX endpoint all present as a dead button even when the catalog still renders.
Common symptoms
- Add to cart button does nothing, flashes, or shows an endless spinner
- Page reloads but the cart remains empty or quantity never increases
- Variable products stay stuck on “Select options” or reject add until refresh
- Browser console shows JavaScript errors or failed `wc-ajax` / `admin-ajax.php` requests
- Works for admins or one browser but fails for guests, mobile, or private windows
- AJAX add-to-cart on shop archives fails while the single product form still works (or the reverse)
- “Sorry, this product cannot be purchased” or nonce/security errors appear intermittently
Most likely causes
- 01 Plugin or theme JavaScript conflict (optimizers, builders, popups, security suites)
- 02 Full-page cache or CDN caching product/cart HTML and serving expired nonces
- 03 Cookies blocked, SameSite/HTTPS mismatch, or WordPress/Site URL mismatch breaking sessions
- 04 Security plugin, host WAF, or Cloudflare rule blocking WooCommerce AJAX POST
- 05 Outdated theme overrides of add-to-cart templates or missing variation scripts
- 06 Product not purchasable (stock, catalog visibility, missing price, incomplete variations)
- 07 Minify/defer/combine settings breaking `jquery`, `wc-add-to-cart`, or variation scripts
What changed before the problem started
- Theme, page builder, or WooCommerce template override was updated
- Caching, Cloudflare, or “performance” plugin settings were tightened
- Security/firewall rules or bot fight mode were enabled
- SSL, domain, or www vs non-www configuration changed
- New popup, optimization, or AJAX-cart extension installed
- PHP or WooCommerce version raised around the same time the button broke
Troubleshooting steps
- 01
Reproduce once and note button vs cart outcome
Test as a guest in a private window on mobile and desktop. Note whether the button ignores clicks, shows an error, reloads with an empty cart, or only fails for variable products. Screenshot the product page before changing plugins.
- 02
Purge caches and exclude cart, checkout, and account URLs
Clear WordPress page cache, host cache, and Cloudflare (if used). Ensure shop, product, cart, and checkout URLs are not full-page cached with stale nonces. Stale add-to-cart HTML is a leading cause of “button does nothing.”
- 03
Inspect Console and Network while clicking Add to cart
Open DevTools → Console and Network, click Add to cart, and capture red JavaScript errors plus failed XHR/fetch to `/?wc-ajax=` or `/wp-admin/admin-ajax.php`. Status codes and response bodies tell you whether this is front-end, blocked AJAX, or a PHP error in the response.
- 04
Verify the product is actually purchasable
Confirm a price is set, stock allows purchase, catalog visibility is Shop/Search as intended, and variable products have attributes selected with in-stock variations. A perfect AJAX stack still cannot add a product WooCommerce marks non-purchasable.
- 05
Conflict-test with a default theme and minimal plugins
Prefer staging. On production, only during a low-traffic window with a full backup. Switch to Storefront or a default Twenty theme and leave only WooCommerce active. If add to cart works, re-enable plugins in small batches—especially optimizers and security—until it breaks again.
- 06
Align HTTPS site URLs and retest cookies
Settings → General should use https for WordPress Address and Site Address with consistent www vs non-www. Mixed content or URL mismatch commonly breaks cart cookies so items never stick for guests.
When to stop troubleshooting
Stop DIY plugin roulette on a live catalog if add-to-cart stays dead through a short maintenance window, WAF changes risk locking out admins, or peak traffic is already bouncing. Request Rescue to restore the cart path with evidence from console/Network logs; for stores that need ongoing checkout, payments, and front-end reliability—not just a one-time button fix—move to Commerce Systems (website Care included) so the next theme or cache change does not silently kill sales again.
Information to collect before requesting help
- 01 Exact symptom (no click response, spinner, empty cart, variation error) plus screenshots
- 02 Browser console errors and failed Network requests when clicking Add to cart
- 03 Whether failure is simple products, variable products, shop AJAX, or all of them
- 04 WooCommerce, theme, and optimization/security plugin versions
- 05 Recent cache, CDN, SSL, or firewall changes
- 06 Whether guests fail while logged-in admins succeed (or the reverse)
- 07 Backup timestamp from before conflict testing
How a professional repairs the problem
We isolate whether the break is JavaScript, cache/nonce, session/cookies, WAF, or a non-purchasable catalog state; restore a clean add-to-cart request on staging or controlled production; repair template overrides and cache exclusions; and confirm simple and variable products land in cart through checkout. After the emergency path is green, Commerce Systems keeps store-front AJAX, caching rules, and related Care updates from undoing the fix—or Request Rescue closes the incident if you only needed break-glass recovery.
Frequently asked questions
Why does the product page look fine but Add to cart fails? +
Can a caching plugin break add to cart? +
Add to cart works for me but not for customers—why? +
Is an empty cart after “success” a different problem? +
Should I switch themes immediately? +
When is Commerce Systems the right follow-up? +
Repair dispatch
Still Need Help Fixing Your Website?
If you are not comfortable editing website files, changing server settings, repairing a database, or troubleshooting a live website, professional help may prevent additional damage or downtime. We will review the problem before accepting the repair.
- You will receive a clear explanation of the likely cause.
- We will tell you if the issue falls outside our repair scope.
- No additional work will be performed without approval.
- A backup should be created whenever access and website condition allow it.
Do not share passwords through an unencrypted contact form — use Password Pusher (self-destructing link). Prefer a dedicated Rescue 404 admin account, not your personal owner login; if you cannot create one yet, we will add ours after repair.