All checkout errorsCheckout error · Magento 2 · ADD_TO_CART_FAILED

Add to cart not working on Magento 2

The shopper picks a product, clicks Add to Cart, and the mini cart stays at zero, or an error appears where the success message should be. The home page and the product pages load normally, so uptime checks stay green, and no customer gets as far as the checkout.

Updated

What the shopper sees on Magento 2

On Luma and themes built on it, Add to Cart posts the product to checkout/cart/add in the background. When it works, Magento shows a success message above the product and the mini cart counter goes up, and some stores send the shopper straight to the cart page instead. Hyvä and headless front ends send an addProductsToCart GraphQL mutation to /graphql, with the same visible result.

When it fails, the shopper gets either an error message from the store above the product or nothing at all: the button goes busy for a moment, the counter does not move, and the cart is empty when they open it.

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 ADD_TO_CART_FAILED.

One size or colour out of stock

A message that the requested quantity is not available is the store answering honestly about one variant. MageSentinel reports it as PRODUCT_NOT_PURCHASABLE, rated "some customers", and does not retry it. When every option of a product is sold out, the monitor moves on to another product before it concludes anything.

Options the shopper has to choose first

A configurable product needs its size or colour picked, and a product with required custom options needs those filled, otherwise Magento asks for the options instead of adding the product. The monitor selects the options before it clicks. If the store still asks for options, the run is shown as not tested, since the store is waiting for a choice it never got. A configurable product that shows no options at all is a page whose option scripts never ran, and the monitor reloads it once.

One product refused, the rest fine

A server error or an error message on a single product says something about that product. Before it calls the cart broken, the monitor tries up to two other products, and the failure then says how many were refused, so you can tell a broken cart from one bad listing.

A theme that never confirms the add

The success message, the mini cart counter and the jump to the cart page all come from the store's JavaScript. When the theme's bundles fail to load, none of them appears even though the product is in the cart. Before it reports anything, the monitor asks Magento directly (customer/section/load?sections=cart), which answers from the quote on the server without the theme's scripts. If the item is there, the add worked. By hand: open the cart page.

Popups, upsells and age checks

An upsell offer that opens after the click, a consent banner, a chat widget over the button or an age check can stop a shopper first. The monitor declines the upsell once, accepts the consent banner, answers the age check with yes and hides chat widgets before it clicks. If something still covers the button, the run reports OVERLAY_BLOCKED and is shown as not tested.

An error that was already on the page

Some stores show an unrelated error as the page loads, for example from a payment button that failed to start. The monitor notes every message on the page before it clicks and counts only what appears afterwards.

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 and no options still does not reach the cart after a clean reload, and the cart page is empty, 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 optional Magento module installed. You can check all of them yourself.

CauseWhat you would seeStrengthCheck first
The store returns a server error on the addA 5xx on checkout/cart/add (Luma) or on the addProductsToCart GraphQL request (Hyvä, headless)Strongvar/log/exception.log and var/report/ at the time of the failure
Something changed since the cart last workedA deploy, a module enabled or disabled, or a configuration change shortly before the first failureMedium (Hint when the change does not touch checkout) · connectorReview that change first. If it was a module, disable it on a staging copy and test again
Static files are missing after a deploy404 responses for the store's own /static/ files on the product pageMediumRun bin/magento setup:static-content:deploy for the affected locales, flush the cache and check pub/static permissions
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 on the store
The store is much slower than usualA check that takes more than twice its usual time, and over 30 secondsHintServer load, slow database queries and cache hit rates at that time
Magento cron has stoppedNo successful cron run for more than 30 minutesHint (Medium after 3 hours) · connectorThe cron service and bin/magento cron:run. A stalled cron leaves indexes and stock stale, so products show that the cart then refuses

Full page cache or Varnish serving private data. Magento loads the mini cart and the form key after the page, from customer/section/load. When a cache layer stores that part too, shoppers get a stale form key or someone else's mini cart, and the add is refused or seems to vanish. Full page cache and checkout shows how to check the headers.

Sessions that do not survive. Magento often keeps customer sessions in Redis. When Redis fills up and evicts keys, carts empty between pages. See Redis for Magento sessions and cache.

Salable quantity. With MSI, a product can show as in stock and still be refused, because reservations used up its salable quantity. That is a stock problem on one product, covered in Magento MSI: in stock but not salable.

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 configurable one, with the console and the Network tab open.
  2. Read the add request. checkout/cart/add on Luma, a graphql request on Hyvä. A 5xx sends you to var/log/exception.log and var/report/, and a 4xx or a message in the response says what Magento refused.
  3. Check the console. If no request leaves at all, a script error stopped the button. 404s for /static/ files point to an incomplete static content deploy: run bin/magento setup:static-content:deploy for the affected locales and flush the cache.
  4. Open the cart page. If the product is there, the add worked and only the theme failed to show it. Look at the theme's scripts and the customer sections next.
  5. Check caching and sessions. The cart and the customer sections must never come from the full page cache or Varnish, and the session store needs room.
  6. Check what changed. Deploys, module updates, catalog imports and reindexes since the last order.

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, and 32% started between 22:00 and 03:00 Athens time, when deploys, cron jobs, indexers and imports tend to run. Read the report.

How MageSentinel reports it

A real browser opens a product on your store on a schedule, picks its options, adds it to the cart and walks on through the checkout. The step is tried twice within the run before it can fail, and a failure carries the screenshot, the network log and the console errors.

What happened after Add to CartReported asCounts as
An error message from the store, or an error status on the add requestADD_TO_CART_FAILEDFailure, all customers
The click landed, nothing confirmed it, and Magento reports the cart emptyADD_TO_CART_FAILEDFailure, all customers
The requested quantity is not availablePRODUCT_NOT_PURCHASABLEFailure, some customers
The button could not be found or pressed, and the store showed no errorMONITOR_COULD_NOT_PROCEEDNot tested, no alert
Something covered the buttonOVERLAY_BLOCKEDNot tested, no alert

An ADD_TO_CART_FAILED run reads "Adding the product to the cart did not work." With the optional connector module installed, the incident also shows what changed on the store since the last passing check. You get one alert when it breaks and one when it recovers.

Check your Magento 2 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 Add to Cart not working in Magento 2?

The usual reasons are a server error on the add request, a script error that stops the button, a cached page that carries a stale form key or mini cart, and sessions that do not survive between requests. The add request in the Network tab and var/log/exception.log tell you which.

02The button works but the mini cart stays empty. Is the cart broken?

Open the cart page. If the product is there, the add worked and the problem is in the theme's scripts or the customer sections, which draw the mini cart. If the cart page is empty too, the add failed.

03Why does it fail on some products only?

Sold-out variants, required options and salable quantity belong to each product. A cart that refuses two or three different products with stock has a cart problem. A single product that refuses has a catalog problem.

04Would an uptime monitor catch this?

No. Every page still answers with a normal status. Only a check that clicks Add to Cart and looks at the cart sees it.