Pingverablog ← Blog
Home › Blog › WooCommerce Add to Cart Not Working: Find the Cause Before Black Friday

WooCommerce Add to Cart Not Working: Find the Cause Before Black Friday

November 18, 2026 · 13 min read

WooCommerce Add to Cart Not Working: Find the Cause Before Black Friday

When WooCommerce add to cart works for you but not for your customers, start with caching. The usual culprits are a cart page served from a page cache or CDN, a cache layer that ignores WooCommerce session cookies, or a cached product page carrying a security token (nonce) that has already expired. The second most common cause is a JavaScript error, often from minified or combined scripts, a plugin update or a theme change, which stops the button's request from being sent at all.

You can tell these apart in about half an hour. Open the store in a private window as a guest, click the button with the browser's network panel open, and look at what request goes out, what status comes back and which cache headers the cart page carries. Black Friday falls on 27 November 2026 and Cyber Monday on 30 November. In the days before them, many stores tighten cache rules, add CDN rules and install updates, and every one of those changes can break the button while your uptime monitor stays green.

At a glance

  • Test as a logged-out visitor in a private window, on a phone as well as a desktop. Many caches skip logged-in users, so an admin session hides the fault.
  • The network panel shows which path is failing: ?wc-ajax=add_to_cart for classic AJAX buttons, a form POST on single product pages, or /wp-json/wc/store/v1/cart/add-item for block-based stores.
  • Cart, Checkout and My Account must never be served from a page cache. WooCommerce's own caching guide says so and lists the cookies to bypass on.
  • A cached page older than about 12 to 24 hours can carry an expired WordPress nonce, and the Store API rejects requests without a valid nonce or cart token.
  • Re-test twice after every fix: once straight after purging the cache and again after the cache has warmed.

Why add to cart breaks in the weeks before peak

Peak preparation means caching changes. The most common one is a CDN rule that starts caching HTML. Cloudflare's documentation states that its CDN "does not cache HTML or JSON by default". Once someone adds a cache rule to cache everything, your cart page can become a cached file unless the rule excludes it or the origin response prevents storage. Cloudflare will not store a response that carries a Set-Cookie header, which protects some cart responses but not cached product pages that show a mini-cart.

WooCommerce's guide to configuring caching plugins lists three pages to exclude from caching: Cart, My Account and Checkout. It says they "need to stay dynamic since they display information specific to the current customer and their cart." It also names the cookies a cache should treat as a signal to bypass: woocommerce_cart_hash, woocommerce_items_in_cart and wp_woocommerce_session_. A rule that excludes /cart/ by path but ignores those cookies will still serve cached product pages to shoppers who have items in their cart, so the mini-cart in the header shows zero.

Expired nonces come next. Block-based add to cart buttons talk to the WooCommerce Store API, and its documentation says the cart/add-item endpoint "will return an error unless a valid Nonce Token or Cart Token is provided." The WordPress nonce documentation gives a default lifetime of one day and explains that the real lifetime falls between 12 and 24 hours. If your page cache holds product pages for longer than that, some visitors receive a page with a stale token embedded in it.

The release calendar adds to this. WooCommerce 11.3.0 shipped on 11 November 2026 with a database update and changes to several product blocks, including the Product Gallery and Product Collection, plus a new read-only parent_item_key field on Store API cart items. The release notes mark it as backwards compatible, and nothing in them describes a change to add to cart. Themes and plugins that customise product blocks or read cart item data still deserve a test on staging. Our WooCommerce 11.3 pre-peak guide covers that update in detail.

The mini-cart can also make a working button look broken. Since WooCommerce 7.8, the wc-cart-fragments script loads only on pages where the Cart widget is rendered, according to the WooCommerce developer blog. A theme that depended on fragments loading everywhere may stop updating its header cart count. The item is in the cart, the counter says zero, and the shopper clicks again or leaves.

How to diagnose it: a 30-minute procedure

  1. Reproduce the fault as a guest. Use a private window with no admin cookies, then repeat on a phone over mobile data. Write down the product type (simple or variable), the page (shop archive or single product) and the device.
  2. Open the browser developer tools on the Network tab and click Add to cart. Find the request it sends. Classic archive buttons call /?wc-ajax=add_to_cart. Single product pages usually submit a form POST to the product URL. Block-based buttons send POST /wp-json/wc/store/v1/cart/add-item.
  3. Read the status code. No request at all points to a JavaScript problem, so switch to the Console tab and read the first red error. A 403 usually points to a firewall or security plugin rule. An error from cart/add-item that mentions the nonce means the page carried a stale or missing token. A 400 on a variable product often means no variation was selected or the variation no longer exists. A 500 is a PHP error, so check WooCommerce > Status > Logs for a fatal-errors entry.
  4. Check the cache headers on the cart and checkout pages from a terminal. A cf-cache-status: HIT, an x-cache: HIT or a non-zero Age header on /cart/ means a cache is serving it.
  5. Check the cookies. After a successful add, the response should set woocommerce_items_in_cart, woocommerce_cart_hash and a wp_woocommerce_session_ cookie. If those cookies never arrive, or arrive and the next page still comes from cache, your cache bypass rules are incomplete.
  6. Turn off JavaScript minification and combining in your performance plugin, purge the cache and test again. WooCommerce's caching guide recommends avoiding JavaScript minification in WP Rocket and gives a specific minify setting for W3 Total Cache.
  7. If the fault survives, run a conflict test on a staging copy. Switch to a default theme, then disable plugins in halves until the button works. Do this on staging, not on the live store during the sale week.
  8. After the fix, test as a guest twice: once right after you purge the cache, when the first request is a cache miss, and again a few minutes later, when the cache has stored the page.

Cause, symptom and check

Likely cause What the shopper sees Where to check Usual owner
Cart page cached at CDN or server Cart empty after adding a product, or someone else's cart curl -sI on /cart/, CDN cache rules Agency or host
Session cookies not bypassing cache Header cart shows 0 on product pages Cache plugin cookie exclusions, CDN rules Agency
Stale nonce in cached page Button spins, then error; nonce error from add-item Network tab, page cache lifetime Agency
JavaScript minify or combine Button does nothing, no request sent Console errors, performance plugin settings Agency
Plugin or theme conflict after update Button broken on one template or product type Staging conflict test Agency or developer
Firewall or bot rule 403 for some visitors or countries WAF and security plugin logs Host or agency
Missing or invalid variation 400 on variable products only Product edit screen, variation stock Store manager

Copyable artefact: cache exclusions and a pre-peak test plan

Hand this to whoever manages your cache plugin, server cache and CDN. Adjust the paths if your cart or checkout pages use a different slug or a language prefix.

NEVER CACHE (page cache and CDN)
  /cart/*            (or your cart slug, every language)
  /checkout/*        (or your checkout slug)
  /my-account/*
  any URL containing ?add-to-cart=
  any URL containing ?wc-ajax=
  /wp-json/wc/store/*

BYPASS CACHE WHEN THE REQUEST CARRIES ANY OF THESE COOKIES
  woocommerce_items_in_cart
  woocommerce_cart_hash
  wp_woocommerce_session_*

PAGE CACHE LIFETIME
  Keep cached HTML shorter than 12 hours if pages embed nonces,
  or confirm your cache plugin refreshes nonces on cached pages.

Quick header check from a terminal (replace the domain and slugs):

for p in / /cart/ /checkout/ /my-account/; do
  echo "== $p"
  curl -sI "https://example-store.com$p" | grep -iE 'cf-cache-status|x-cache|^age|cache-control|set-cookie'
done

Pre-peak add to cart test plan:

Run after every cache rule change, plugin update or theme change,
and once a day from now until the end of Cyber Monday.

[ ] Guest, desktop, private window: simple product from shop archive
[ ] Guest, desktop: simple product from single product page
[ ] Guest, desktop: variable product, select variation, add
[ ] Guest, phone on mobile data: repeat the three tests above
[ ] Header mini-cart count updates without a page reload
[ ] Cart page shows the item; refresh keeps it there
[ ] Second browser, guest: cart is empty (not the first browser's cart)
[ ] Logged-in customer account: add, view cart, start checkout
[ ] Repeat all guest tests 10 minutes after a cache purge
[ ] Record date, tester, result and any error text in the change log

The "second browser" line matters most. If a fresh guest sees items they never added, the cart page is cached and is showing one shopper's session to another.

Worked scenario (illustrative)

The numbers here are illustrative, not data from a real store.

A store that sells kitchen equipment expects four times its normal traffic on Black Friday. On 16 November, the agency adds a CDN rule that caches HTML for two hours, with exclusions for /cart/, /checkout/ and /my-account/. The store runs in two languages, and the second language uses /de/warenkorb/ as its cart URL. Nobody adds that path to the exclusion list.

For three days, the German cart page comes from cache. Most visitors see an empty cart after adding a product. A few see a cart that holds another visitor's items. The uptime monitor reports 100%, and the English store sells as usual, so total orders fall by about a fifth instead of dropping to zero. That kind of partial drop is easy to miss.

A customer email reports the problem on 19 November. The developer runs the header check against /de/warenkorb/, sees cf-cache-status: HIT, adds the path and the cookie bypass rules, purges the CDN and runs the full test plan in both languages. The fix took 20 minutes; the German cart had been broken for three days before anyone noticed.

Common mistakes

  • Testing while logged in as an administrator. Many cache plugins and hosts bypass cache for logged-in users, so you never see what a guest sees.
  • Testing once, straight after a purge. The first request is a miss and works; the cached copy served to the next thousand visitors is the one that breaks.
  • Excluding /cart/ but forgetting translated slugs, a custom cart page or the cookie bypass rules.
  • Turning off caching entirely the week before Black Friday. That trades a cart bug for a load problem. Fix the exclusions instead, and see our guide to updating WooCommerce safely for staging and rollback habits.
  • Treating a green uptime check as proof the store is selling. An uptime check requests a page; it does not add a product to a cart.

This guide covers WooCommerce on WordPress. Shopify and Magento handle carts differently, though the guest test, the network panel and the cache header check apply to any platform. Some managed hosts run server caches you cannot configure yourself, so you may need to send the exclusion list to their support team. Security plugins and WAFs vary too much to cover here; if you see 403 responses, their logs will tell you which rule fired.

FAQ

Why does add to cart work for me but not for my customers?

You are probably logged in. Many caches skip logged-in users and serve guests a cached copy of the page, which may contain an old nonce or a cached cart. Test in a private window as a guest, on a second device.

Should I disable caching before Black Friday to avoid cart problems?

No. Keep caching for product and category pages, which carry most of the traffic, and exclude cart, checkout, account pages and add to cart requests. Then run the test plan above after every change.

Add to cart works, but the cart page is empty. What causes that?

Most often the cart page or the request after it comes from a cache that ignores the WooCommerce session cookies. Check the cart page headers for a cache HIT and confirm that woocommerce_items_in_cart and wp_woocommerce_session_ cookies trigger a bypass.

Catch the drop even when the button looks fine

A daily manual test catches most add to cart faults, but not the one that appears an hour after you ran it. Pingvera's WordPress connector sends WooCommerce order events in real time, and its anomaly detector compares order flow with an hourly baseline, so you get an alert when the site is up but orders have stopped or fallen. The unified timeline places that drop next to deploys and incidents, so a cache rule change and the hour sales fell show up side by side. Pingvera does not click your button for you; it watches the orders that should follow. For the wider picture, read how to monitor WooCommerce checkout and catching a store that stopped selling.

Sources

  • WooCommerce developer docs, Configuring caching plugins: https://developer.woocommerce.com/docs/best-practices/performance/configuring-caching-plugins
  • WooCommerce developer docs, Store API cart endpoints: https://developer.woocommerce.com/docs/apis/store-api/resources-endpoints/cart/
  • WooCommerce developer docs, Store API nonce tokens: https://developer.woocommerce.com/docs/apis/store-api/nonce-tokens
  • WooCommerce developer docs, Store API cart tokens: https://developer.woocommerce.com/docs/apis/store-api/cart-tokens
  • WooCommerce developer blog, Best practices for the use of the cart fragments API (16 June 2023): https://developer.woocommerce.com/2023/06/16/best-practices-for-the-use-of-the-cart-fragments-api/
  • WooCommerce 11.3.0 release notes (11 November 2026): https://developer.woocommerce.com/2026/11/11/woocommerce-11-3-0-release-notes/
  • WooCommerce 11.3 developer pre-release notes (26 October 2026): https://developer.woocommerce.com/2026/10/26/woocommerce-11-3-pre-release/
  • WooCommerce source, class-wc-ajax.php: https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/includes/class-wc-ajax.php
  • WordPress developer docs, Nonces: https://developer.wordpress.org/apis/security/nonces/
  • Cloudflare docs, Default cache behavior: https://developers.cloudflare.com/cache/concepts/default-cache-behavior/
  • Cloudflare docs, Cloudflare cache responses: https://developers.cloudflare.com/cache/concepts/cache-responses/

Last reviewed: 2026-11-18

Know about problems before your customers do

Pingvera watches whether an online business actually works — uptime, checkout, orders, domain, SSL and server — and alerts you in Telegram, email or a webhook before a customer has to tell you.

Start free

Read next: WooCommerce checkout monitoring: how to catch a dead checkout before the client calls · WooCommerce 11.3 Before Black Friday: What Changed and What to Test.

Read next: PayPal IPN Not Working: Fix Stuck Orders Before Peak · WooCommerce Not Sending Order Emails: Fix It Before Peak · WooCommerce Coupon Not Working? Fix It Before Black Friday · Ecommerce Site Search Optimisation Guide · Run a free site check.

← All articles · Privacy policy · pingvera.com