Where creative ideas grow  ·  Building and maintaining websites since 2018, from Rajshahi, Bangladesh

WooCommerce 6 min read

WooCommerce Add to Cart Not Working: How to Fix It

Add to cart not working on your WooCommerce store? Check JavaScript conflicts, caching and stock settings to find the cause in minutes.

Illustrated guide: WooCommerce Add to Cart Not Working: How to Fix It

WooCommerce add to cart not working usually comes down to a JavaScript conflict, caching serving an old version of the page, or a theme template that has drifted out of sync with WooCommerce. None of the common causes need touching the database. Work through the checks below in order and you will almost always find it within a few minutes.

Add to cart not working shows up in a few different ways: the button might do nothing at all, spin forever, show “0” items added, or reload the page without actually adding the product. Each variant points toward a slightly different cause, which the checks below will narrow down quickly.

Check the browser console first

Right-click the page, choose Inspect, and open the Console tab. Click Add to Cart again and look for a red error message. It often names the exact script causing the problem, which saves you from checking every possible cause manually.

Quick checks before anything else

  • Clear your site’s caching plugin cache completely, and also clear your browser cache, since a cached old version of the product page is one of the most common causes.
  • If you use Cloudflare or another CDN, purge its cache too; page-level caches sometimes get missed by a plugin’s own “clear cache” button.
  • Test in a private/incognito browser window, which rules out a browser extension or stale local cache on your own device.
  • Confirm the product actually has stock and is published, not stuck in draft.

Find a JavaScript conflict

WooCommerce’s Add to Cart button relies on JavaScript to work smoothly, whether it is the AJAX version that adds the item without reloading the page, or the plain version that submits a form. A conflicting script from a theme, plugin or third-party tracking code can silently break this.

Deactivate all plugins except WooCommerce, and switch temporarily to a default theme such as Storefront or Twenty Twenty-Five. Test Add to Cart. If it works now, reactivate plugins one at a time, testing after each, until you find the one causing the conflict. This process is slower than reading a code diff, but it is far more reliable than guessing, especially on a store with a dozen or more active plugins where several could plausibly be the cause.

WooCommerce’s own developer documentation on template structure explains how theme overrides work, which is useful background if a custom or heavily modified theme turns out to be the source of the conflict.

Common culprits Why
Page builder plugins (custom product page templates) Can override WooCommerce’s default markup and lose the required data attributes
Minification/combine-JS speed plugins Can break WooCommerce’s own scripts if combined incorrectly
Custom-coded themes May be missing required WooCommerce template hooks
Analytics or chat widget scripts Can throw a JavaScript error that stops all further scripts running on the page

Check the AJAX add to cart setting

Go to WooCommerce → Settings → Products → General and check the box for “Enable AJAX add to cart buttons on archives”. With this off, clicking Add to Cart from a shop or category page should still reload the page and add the item; if it does neither, that confirms a script or template problem rather than a settings issue.

On the single product page, the add-to-cart form also depends on WooCommerce’s core JavaScript being correctly enqueued. A theme that removes or improperly overrides woocommerce_template_single_add_to_cart can break this even with the setting correctly enabled.

Rule out caching properly

Caching plugins sometimes cache the cart fragments AJAX response or the mini-cart, which can make it look like nothing was added even though the item is actually in the cart. In your caching plugin, confirm the cart page and checkout page are excluded from caching, and that “cart fragments” or AJAX requests are not being cached.

If you use a full-page cache like WP Rocket, LiteSpeed Cache or a server-level cache, check specifically for a WooCommerce compatibility mode or exclusion list, since most caching plugins ship with WooCommerce-aware defaults that can be accidentally turned off.

Stock, variations and other settings that block adding to cart

  • Out of stock with “hide out of stock items” off: the button may still show but do nothing. Check Product data → Inventory.
  • Variable products with no variation selected: the button is often intentionally disabled until all required options are chosen; confirm every attribute has a value.
  • Minimum/maximum quantity plugins: a rule that is not met silently blocks the add, sometimes without a visible error.
  • Product visibility catalog settings: set to “Shop only” or similarly restricted in a way that hides the purchase button on certain page types.

If the console shows a 500 or 403 error

Add to cart not working alongside a 500 or 403 error in the console points to a server-side problem instead of a front-end script conflict. Check your site’s error log, and see our guide on the WordPress 500 internal server error if that is what you are seeing in the console’s network tab.

A security plugin or firewall rule blocking AJAX requests can also cause this; temporarily whitelist your own IP or pause the firewall to test.

Test on mobile separately from desktop

Add to cart not working sometimes only shows up on mobile, since a JavaScript conflict or a slow third-party script can break the button there while desktop looks fine, either because a mobile-specific theme layout uses a different template, or because a slower connection causes a script to time out before the button becomes clickable. Test on an actual phone, or use Chrome DevTools’ device emulation with network throttling switched on, rather than relying only on a fast desktop connection.

After you fix it: test the full checkout flow

Once Add to Cart works again, place a full test order through to payment to confirm nothing else broke along the way, especially if the fix involved deactivating and reactivating several plugins. If checkout itself has separate problems beyond the add-to-cart step, our broader WooCommerce checkout not working guide picks up from there.

Rather have it fixed for you?

We fix WooCommerce add to cart not working and other store issues from $45, usually the same day. Get your store fixed or contact us with your site address.

WooCommerce add to cart not working: quick answers

Why does WooCommerce add to cart not working only happen on some products?

This usually points to a product-specific setting: out-of-stock status, a variable product with a missing required attribute, or a custom field added by a plugin that is blocking the purchase for that item specifically. Compare a broken product against a working one in Product Data.

Why does the cart icon not update after adding a product?

This is often a cached mini-cart or cart-fragments AJAX response. Clear your caching plugin’s cache and confirm cart fragments are excluded from caching in its settings.

Can a security plugin cause WooCommerce add to cart not working?

Yes, an overly strict firewall rule can block the AJAX request WooCommerce uses to add items, especially rules targeting unusual POST requests. Check the security plugin’s activity log for a blocked request around the time you clicked Add to Cart.

Does updating WooCommerce fix add to cart problems caused by an old theme?

Sometimes, but an outdated theme built for an older WooCommerce version is a common root cause, so updating the theme itself, not just WooCommerce, is often the real fix. Check the theme developer’s changelog for WooCommerce compatibility notes.

Sukumar Mahato

Sukumar Mahato

Founder · Full-stack developer

Founded Mahatosoft in 2018. Has shipped and rescued more than 420 projects across React, Node.js and WordPress — and still takes the emergency calls himself.

Free 15-minute consultation

Let’s scope your project properly.

Tell us what you need built or fixed. You get an approach, a timeline and a fixed price — usually within a few hours.