The shop says "added to your cart", but the cart page shows Your cart is currently empty, the cart icon stays at 0, or the cart empties when the customer reaches checkout. Customers who see this leave. It is almost always one of two things: a cached copy of the cart page, or the shop losing track of who the customer is. Two checks tell you which.
Open the shop in a private window, add a product, then open the cart page with ?nocache=1 added to its address (for example /cart/?nocache=1). If the product shows there but not on the plain /cart/ address, a cache is serving an old, empty copy of the page. Look at every cache layer you have: a caching plugin (WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache), your host's server cache, and Cloudflare. Each must leave the cart, checkout and my account pages uncached, and must not cache pages for visitors who carry the woocommerce_items_in_cart or wp_woocommerce_session_ cookies.
Still in the private window, press F12, open Application (Chrome) or Storage (Firefox) and then Cookies. After adding a product you should see a cookie starting with wp_woocommerce_session_. If it never appears, or appears and then disappears on the next page, the shop cannot remember the cart. Common reasons: the site mixes www and non-www or http and https addresses, so the cookie is set on one and read on the other; a cookie consent plugin blocks WooCommerce cookies until the visitor clicks accept; or Cloudflare or a security plugin strips cookies.
| What you see | Cause | Fix |
|---|---|---|
Product appears with ?nocache=1, not without | Cart page cached by a plugin, the host or Cloudflare | Exclude cart, checkout and my account from every cache layer, and skip cache for visitors with WooCommerce cookies; then purge all caches |
| Cart icon stays at 0 but the cart page is right | The mini cart in the header is cached or its refresh script is delayed by a speed plugin | Exclude wc-cart-fragments from JavaScript delay and combine options |
| No session cookie, or it vanishes | www/non-www or http/https mismatch between the WordPress Address and Site Address | Make both addresses in Settings > General identical and redirect every other form to that one |
| Cart works only after accepting cookies | A consent plugin blocks WooCommerce's necessary cookies | Mark the WooCommerce session and cart cookies as strictly necessary in the consent plugin |
| Cart empties on the way to checkout | Cart and checkout pages on different addresses, or a checkout page that is not the one set in WooCommerce settings | Check WooCommerce > Settings > Advanced: the cart and checkout pages are the real ones, on the same domain |
| Cart empties after some minutes or hours | Sessions are cleared early, often by a database cleanup plugin emptying the sessions table | Stop the cleanup plugin from touching woocommerce_sessions; WooCommerce clears expired sessions itself |
| Products added, nothing happens at all | A JavaScript error on the product page stops the add to cart request | Read the Console on the product page; see the add to cart guide linked below |
Purge every cache, then in a fresh private window add two different products, open the cart, change a quantity, and go through to checkout. The cart count, the cart page and the checkout order summary should all agree. Repeat once on a phone over mobile data, since some caches only serve phones.
woocommerce_sessions table by hand on a busy shop. Every live cart in it disappears.If you would rather someone else finds why the cart empties and fixes it, that is what the box below is for. Related: add to cart button not working, checkout not working, changes not showing (cache).