WooCommerce add to cart button not working
When WooCommerce add to cart fails, test logged out first: if it only breaks for visitors, page caching is serving them a cart without a session, and Cart, Checkout and My Account need excluding from every cache layer. If it fails for everyone, a plugin is throwing a JavaScript error or blocking the wc-ajax request, which a Troubleshooting Mode test will confirm. Mismatched WordPress Address and Site Address settings and outdated theme template overrides are the other common causes.
What you'll see
The button spins and never finishes, does nothing at all, or the page reloads and the cart count stays at zero. Very often it works perfectly for you because you are logged in as an admin, while customers report that nothing goes into the cart. It may also fail only on phones, or only on shop and category pages but not on single product pages.
Why it happens
1. Caching serves visitors a page without a cart session
Page caching plugins, host-level caches and CDNs can serve logged-out visitors a stored copy of a page, including cart fragments that belong to nobody. Admins usually bypass the cache, which hides the bug from the person trying to fix it.
2. A plugin breaks the request or the page’s scripts
Form, anti-spam, security and tracking plugins sometimes throw a JavaScript error that stops WooCommerce’s add to cart script, or a firewall rule blocks the wc-ajax request it sends.
3. Site URLs or cookies do not line up
If Settings > General has different WordPress Address and Site Address values, for example one with www and one without, the session cookie can be set on one host and read on another, so the cart never sticks.
4. The theme carries outdated WooCommerce templates
Themes can override WooCommerce templates such as the add to cart form. When WooCommerce changes those templates and the theme’s copies do not keep up, buttons can lose the attributes the scripts rely on.
How to fix it
- Log out, open a private window and try adding a simple product and a variable product. If it works when logged in but fails here, focus on caching first.
- Open DevTools > Network and click Add to cart on a shop page. With AJAX add to cart enabled, look for a request ending in ?wc-ajax=add_to_cart and check its status code and response. On a single product page the classic form posts back to the page instead.
- Install the Health Check & Troubleshooting plugin and enable Troubleshooting Mode, which runs only WooCommerce and a default theme for your session. Re-enable plugins one by one until the button breaks again.
- In your caching plugin, host panel and CDN, exclude the Cart, Checkout and My Account pages, and make sure requests carrying the woocommerce_items_in_cart or wp_woocommerce_session_ cookies bypass the cache. Purge every cache afterwards.
- Go to Settings > General and confirm WordPress Address (URL) and Site Address (URL) match exactly, including https and www.
- Open WooCommerce > Status and scroll to Templates. Any override marked as outdated should be updated by the theme developer, or by you in a child theme.
How to check it's fixed
- Logged out on a desktop browser and on a phone, add a simple product and a variable product from both the shop page and the product page; the cart count should rise each time.
- Open /cart in the same session and confirm both products are listed with the right quantities.
- Repeat after purging caches the next day, since cache problems sometimes only return once pages are cached again.
What a QAlaunch scan shows for this
- JavaScript errors on the page and failed network requests, as seen by an anonymous, logged-out visitor.
- Whether the page’s primary button is visible and leads somewhere when clicked, on desktop and at phone width.
- It reports what a visitor experiences but cannot see your caching plugin, host or CDN settings, so a cache cause is inferred, not confirmed.
See exactly what a full report contains in the sample report.
Frequently asked questions
Why does add to cart work for me but not for customers?
Logged-in administrators are usually excluded from page caching, so you always get a fresh page with a working session. Visitors get the cached copy. Always test in a private window while logged out.
Should I turn off AJAX add to cart?
You can untick Enable AJAX add to cart buttons on archives under WooCommerce > Settings > Products as a test. If the classic reload works, the problem is with the AJAX request, often a blocked or cached wc-ajax call, rather than the cart itself.
Is Troubleshooting Mode safe on a live shop?
Yes. Health Check’s Troubleshooting Mode disables plugins and switches theme only for your logged-in session, so customers keep seeing the normal site while you test.
Rather have a QA engineer test it by hand?
If this is a site you're launching or handing to a client, I'll go through it by hand, including the WooCommerce-specific issues a scan can't reach, like logged-in flows.
- Up to 10 key pages tested by hand, not a scan
- Every flow a customer uses: forms, sign-up, checkout, booking
- Real mobile and desktop browsers
- A written report in plain language, with screenshots
- A 15-minute call to walk you through it
- 10 years of professional QA experience
Tell me about your site and I'll reply personally, usually the same day.
No payment now. I'll confirm scope and price first.
Related fixes
More for WooCommerce: all WooCommerce fixes · WooCommerce testing
Written by Waqas Ahmad, QA engineer with 10 years of professional testing experience. Last checked October 26, 2026.
Sources: WordPress.org support: cannot add anything to my cart · WordPress.org support: add to cart not working on mobiles · WPFixit: WooCommerce add to cart button not working