All checkout errorsCheckout error · WooCommerce · ADD_TO_CART_FAILED

Add to cart not working on WooCommerce

The shopper clicks Add to cart and nothing lands in the cart: an error notice appears, or the page reloads and the cart is empty when they open it. The shop and the product pages keep loading, so it can go unnoticed until someone asks why the orders stopped.

Updated

What the shopper sees on WooCommerce

On a product page, Add to cart submits the product form. On a default setup WooCommerce reloads the page with a notice that the product was added, or sends the shopper to the cart if the store is set to. On shop and category pages the button can add in the background through ?wc-ajax=add_to_cart (the AJAX add to cart setting under WooCommerce → Settings → Products), and the mini cart then refreshes through cart fragments. Many themes use the same background add on product pages too.

When it fails, the shopper gets an error notice above the product or nothing at all: the count in the header stays the same and the cart page says the cart is empty. A cart page that prints PHP warnings where the products should be has the same effect.

First, rule out the lookalikes

Several things look like a broken add to cart and turn out to be something else. MageSentinel checks for each of them before it reports a cart failure on WooCommerce.

Variations and required options

A variable product needs its attributes picked, and product options plugins add required fields of their own. Without them WooCommerce or the browser's own form validation refuses the add. The monitor picks the variations and answers each required select or radio group with its first available option before it clicks. When the store hides the add button behind a "configure" or "personalise" step, it opens that step first.

A popup over the button

A newsletter popup on a timer, a promotion, a chat panel or an age check can take the click a shopper aims at the button. The monitor accepts consent banners, answers age checks with yes and clears whatever covers the button before it clicks. A click that still never lands, while the store shows no error, is reported as not tested (MONITOR_COULD_NOT_PROCEED) and sends no alert.

The Store API and the cart page disagree

The monitor first asks WooCommerce's Store API what the cart holds. When the API says the cart is empty, it opens the cart page, which is what the shopper sees, and only that page counts. It matches the cart line to the product it added, so an item left by an earlier attempt is never taken for this one.

An empty cart on a very slow store

On a store whose pages take seconds to start answering, the cart can be read before the add has come back. When the store's pages averaged 5 seconds or more to first byte, an empty cart is reported as the store being too slow to complete a purchase (TIMEOUT) instead of a cart failure.

A host that rate-limits

Some hosts answer a quick run of requests with HTTP 429. A cart page refused that way says nothing about the cart. When the store refuses requests with 429 while the monitor adds to the cart, the run is reported as not tested (WAF_CHALLENGE) and says how many requests were refused.

A failure that does not repeat

A failed run is repeated straight away in a fresh browser, with a different product when the store has one. Only a second failure at the same step or an earlier one counts. If the second run passes, the pass is what gets recorded, and nobody is alerted about a single bad page load.

If a simple product with stock still does not reach the cart page after a clean reload, in a private window, add to cart is broken for your customers.

Causes, ranked by how strong the evidence usually is

Strength says how much a signal tells you once you find it. It is a judgement about evidence and not a probability. Causes marked "connector" are the ones MageSentinel can only name with its free WordPress plugin, MageSentinel Monitor, installed. You can check all of them yourself.

CauseWhat you would seeStrengthCheck first
The store returns a server error on the addA 5xx on the product form submit, on ?wc-ajax=add_to_cart, or on the cart pageStrongWooCommerce → Status → Logs (fatal-errors) and the PHP error log at that time
A plugin, theme or setting changed since the cart last workedA plugin or theme update or a WooCommerce setting change shortly before the first failure. The plugin lists recent updates by name and versionMedium (Hint when the change does not touch checkout) · connectorRoll that change back on a staging copy and test again
Theme or plugin files are missing404 responses for the store's own static files on the product pageMediumMake sure the theme or plugin those files belong to is fully installed, then purge the cache or minify plugin and the CDN
A third-party script on the page started failingEvery request to one outside host fails, and the page's JavaScript fails with itMediumLoad the product page with that host blocked. If add to cart works, stop loading that tag
The store is much slower than usualA check that takes more than twice its usual time, and over 30 secondsHintServer load, PHP workers and slow database queries at that time
WP-Cron has stoppedNo successful WP-Cron run for more than 30 minutesHint (Medium after 3 hours) · connectorThat a server cron calls wp-cron.php. Rarely the cause by itself, but it makes failures look random

A cache that serves the cart. If a page cache, a host cache or a CDN rule serves /cart/ or ignores the WooCommerce session cookies, the add lands in a session the shopper never sees again. Keep /cart/, /checkout/ and /my-account/ out of every cache layer, and skip the cache for visitors who carry the woocommerce_items_in_cart or wp_woocommerce_session_ cookies. Cloudflare and CDN rules that break checkout covers the rules.

A script error that stops the background add. Another plugin's JavaScript error can stop the add to cart script before it sends anything. Turn off AJAX add to cart under WooCommerce → Settings → Products and try again: if the plain form works, a script is the problem. Cart fragments, the request that refreshes the mini cart, are covered in cart fragments and a slow WooCommerce store.

Fix it, step by step

  1. Reproduce it as a guest. In a private window, with a simple product that has stock and then a variable one, with the console and the Network tab open.
  2. Open the cart page. If the product is there, the add worked and only the notice or the mini cart failed: look at cart fragments and the theme's scripts.
  3. Read the add request. A 5xx on the form submit or on ?wc-ajax=add_to_cart sends you to WooCommerce → Status → Logs. A PHP warning on the cart page names the file, and the path names the plugin.
  4. Check the console. A script error before any request leaves points to a plugin or the theme. Disable plugins one at a time on staging until it works.
  5. Check the caches. Purge every cache layer, then confirm that cart, checkout and my-account are excluded and that the session cookies bypass the cache.
  6. Check what changed. Plugin, theme and WooCommerce updates since the last order that went through.

How often this happens

In our study of about 98,000 test purchases on 135 Magento and WooCommerce stores (23 August to 14 October 2026), cart problems, such as add to cart failing or a price that changed in the cart, were 12% of the incidents with a clear cause. Every test purchase added a product to the cart, so this step was measured on every run. 77% of all incidents happened while the store's site was up. Read the report.

How MageSentinel reports it

A real browser opens products on your WooCommerce store on a schedule, picks variations and options, adds one to the cart and reads the cart through the Store API and the cart page. When one product fails, it moves on to the next one it found, so a single broken listing does not fail the run, and the failure says how many products were tried.

What happened after Add to cartReported asCounts as
An error notice from WooCommerce, or PHP errors on the cart pageADD_TO_CART_FAILEDFailure, all customers
The click landed and the cart stayed empty, with no noticeCART_PRODUCT_MISSINGFailure, all customers
The click never landed, and the store showed no errorMONITOR_COULD_NOT_PROCEEDNot tested, no alert
The store answered with HTTP 429WAF_CHALLENGENot tested, no alert

An ADD_TO_CART_FAILED run reads "Adding the product to the cart did not work." and a CART_PRODUCT_MISSING run "The product did not appear in the cart." Both carry the screenshot, the network log and the console errors. With the MageSentinel Monitor plugin installed, the incident also lists recent plugin and theme updates. You get one alert when it breaks and one when it recovers.

Check your WooCommerce checkout now, free and without signing up.

The free test walks your checkout in a real browser and shows the step where it stops.
FAQ

Common questions

Still have a question?More answers, and a way to reach us.Support →
01Why is the WooCommerce add to cart button not working?

The usual reasons are a page or CDN cache that serves the cart or ignores the session cookies, a JavaScript error from another plugin that stops the background add, required options or variations that were not picked, and a PHP error during the add. The cart page, the console and WooCommerce → Status → Logs tell you which.

02The product was added but the mini cart still shows zero. Why?

The mini cart is refreshed by cart fragments and the theme's scripts. If the cart page holds the product, the add worked and the refresh failed, for example because a cache or an optimisation plugin interferes with that request.

03Why does it work for me and not for customers?

A store owner who is logged in usually skips the page cache. Test in a private window as a guest, with a product and options your customers pick.

04Would an uptime monitor catch this?

No. Every page still answers with a normal status. Only a check that adds a product and opens the cart sees it.