On this page
What this issue is
A shopper changes a quantity in the cart, from 1 to 3 for example. The number in the box changes, but the subtotal, shipping or order total stays the same. Or the total updates on screen but reverts when they reach checkout.
Most carts update through AJAX, which means the page sends a small background request to the server and redraws part of the page with the reply. If that request fails, is cached, or the page ignores the reply, the total is never redrawn.
Why it costs you leads or sales
Shoppers do not know which number to trust. If the total looks wrong they may stop, suspect a pricing error, or leave to compare elsewhere. If the screen total is lower than the real one, they get a surprise at checkout. If it is higher, they may never buy the extra items.
- Add to cartItem added correctly
- Change quantityShopper sets 1 to 3
- Recalculate totalRequest fails or reply ignored
- CheckoutShopper doubts the price and leaves
- PurchaseSale lost
The quantity change is sent, but the total never refreshes, so the later steps are lost.
Example: illustrative numbers only. Carts where the total updates correctly versus carts where it does not.
How to check if your site has it
Use a clean browser
Open a private window with no extensions so cached data and ad blockers do not hide the cause.
Add a product and note the total
Write down the line price, subtotal, shipping and order total.
Change the quantity
Use the plus button, the number box and the Update cart button if your theme has one. Test each way.
Compare the numbers
The total should equal price x quantity plus shipping and tax. Check that the cart count in the header also changes.
Reload the page
If the total reverts after reload, the screen updated but the server did not save the change.
Open DevTools
In Chrome press F12, open the Network tab and change the quantity. Look for the request (on Shopify /cart/change.js or /cart/update.js, on WooCommerce admin-ajax.php or a wc-ajax call). Note its status code and the Console tab for red errors.
| What you see | Likely cause |
|---|---|
| No request sent | JavaScript error or a button covered by another element |
| Request returns 4xx or 5xx | Server error, security token expired, or a firewall rule |
| Request returns 200 but total is old | Cached response or theme ignores the reply |
| Total right after request, wrong after reload | Change not saved to the session or cart cookie |
How to fix it
The fix depends on which row of the table you matched. Start with the generic steps, then use your platform's tab.
Fix JavaScript errors first
Any red error in the Console on the cart page can stop the update script. Disable recently added apps or plugins one at a time to find the one that conflicts.
Exclude the cart from caching
Cart, checkout and account pages and cart AJAX calls must never be served from a page or CDN cache.
Make sure the theme redraws the total
After the quantity request succeeds, the theme must re-render the cart totals from the reply.
Check stock and limits
If the requested quantity exceeds stock or a maximum, the platform may reject it silently. Show a clear message instead.
Test with a default theme
On a staging copy, switch to a default theme such as Twenty Twenty-Four. If the total updates, your theme's cart template or script is the cause.
Deactivate plugins one by one
In Plugins, deactivate optimisation, popup and cart add-on plugins first, retesting after each.
Exclude cart from cache
In your caching plugin's settings, exclude the Cart and Checkout pages and the cookies woocommerce_cart_hash and woocommerce_items_in_cart. Also exclude JavaScript from delay or minify options if the cart script breaks.
Check the cart page template
In WooCommerce, make sure the Update cart button is not removed by theme overrides. Overridden templates in your theme's woocommerce folder can be out of date; compare them with the plugin's version.
Test with the Dawn theme
Preview your store in the free Dawn theme with the same product. If it works, the problem is in your theme code.
Check cart apps
In Apps, disable upsell, drawer or discount apps that modify the cart, then retest.
Review the theme's cart script
Find the code calling /cart/change.js and confirm it uses the returned cart to re-render the totals section. Edit via Online Store > Themes > Edit code, on a duplicate theme first.
Rule out custom HTML tags
In Preview mode, pause tags one by one. A Custom HTML tag that overrides fetch or XMLHttpRequest, or that errors on the cart page, can break the update.
Check triggers on the cart page
Look for tags firing on all clicks or DOM changes on the cart page that change or block the quantity buttons.
Check the cart element settings
In the Designer, select the Cart element and its quantity input and confirm they are bound to the cart item's quantity and not replaced with a plain input.
Remove custom code
In Site settings > Custom code, and page-level code, temporarily remove scripts that touch the cart, then publish and retest.
Check Wix Stores settings
Confirm you are using the current Wix Stores cart page and that the quantity control has not been hidden or replaced.
Remove custom code
If you use Velo or custom embeds on the cart page, disable them and retest.
Remove code injection
In Settings > Advanced > Code Injection, remove scripts that affect the cart, then retest.
Test in a clean session
Squarespace carts rely on cookies, so test in a private window with cookies enabled.
Recompute on the server
Always calculate totals on the server from the saved quantities. Never trust a total sent from the browser.
Redraw from the reply
After the request succeeds, update the DOM from the response, as in the example below.
Disable caching for cart calls
Send Cache-Control: no-store on the cart endpoints.
async function setQuantity(lineKey, quantity) {
const res = await fetch('/cart/change.js', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ id: lineKey, quantity: quantity })
});
if (!res.ok) {
console.error('Quantity update failed', res.status);
return;
}
const cart = await res.json();
document.querySelector('[data-cart-total]').textContent =
(cart.total_price / 100).toFixed(2);
document.querySelector('[data-cart-count]').textContent = cart.item_count;
}How to confirm it's fixed
- Changing quantity with plus, minus and typing all update the line total.
- Subtotal, shipping and order total change together.
- The header cart count matches the new quantity.
- The total is still correct after a page reload.
- The same total appears at checkout.
- No red errors in the Console and the cart request returns 200.
- Tested on mobile and desktop, logged in and logged out.
Broken
- Quantity changes to 3, total still shows one item
- No message when the request fails
- Total differs at checkout
Fixed
- Total redraws within a moment of the change
- Errors show a clear message
- Cart and checkout totals match
How to prevent it happening again
- Run the quantity test after every theme update, app install or cache setting change.
- Test changes on a staging copy or duplicate theme first.
- Keep cart and checkout excluded from every cache layer, including the CDN.
- Keep a short written test script so anyone on the team can repeat it.
- Review Console errors on the cart page after each release.
How FunnelGuard handles this
FunnelGuard does not check this yet. Asserting the cart total after a quantity change is a possible future check, not a current feature.
What FunnelGuard does today is run your real customer journeys on a schedule, such as a checkout or lead form, from the EU or the US, and check each step. If a journey stops working because a page error or a covered button blocks the path, a failure is re-checked from a second region and you get one alert with a screenshot and a likely cause. That can surface a broken cart page, but it does not compare totals after a quantity change.
To watch for this issue today, add the manual test above to your release checklist and run it weekly. You can also use any browser automation tool you already have to change a quantity and assert the displayed total. A free FunnelGuard plan (1 site, 2 journeys, daily checks, no card) can cover the wider path to checkout while you do that.
Questions people ask
Why is my cart total not updating when I change the quantity?
Usually the quantity request fails or the page ignores the reply. Common causes are a JavaScript error from a plugin or app, a cached cart response, or a theme that doesn't redraw the totals. Open DevTools, change the quantity and check the Network and Console tabs to see which one it is.
Why does the cart total change back after I refresh the page?
The screen updated but the server never saved the new quantity. This often happens when the request fails silently, the cart cookie or session is not stored, or a cache serves an old cart. Check the request status and make sure cart pages are excluded from caching.
How do I fix the Update cart button not working in WooCommerce?
Deactivate plugins one at a time, especially caching, optimisation and cart add-ons, and test with a default theme. Exclude the Cart and Checkout pages from caching, and compare any overridden templates in your theme's woocommerce folder with the current plugin versions.
Can caching stop the cart total from updating?
Yes. If a page cache or CDN serves a stored version of the cart or its AJAX responses, shoppers see old totals. Exclude cart, checkout and account pages and cart endpoints from every cache layer, or send a no-store cache header.
How do I test that a cart quantity change recalculates the total?
Add a product in a private browser window, change the quantity using each control, and check the line total, subtotal, shipping and order total. Reload the page and go to checkout to confirm the numbers still match.
Does FunnelGuard check cart quantity updates?
No, not yet. Asserting the total after a quantity change is a possible future check. FunnelGuard currently runs your journeys such as checkouts and lead forms on a schedule and checks each step, so use a manual test for quantity changes.
Is a wrong cart total a conversion problem or a trust problem?
Both. Shoppers who see a total that does not match their quantity may think the price is wrong and leave, even if checkout would have been correct. Fixing it removes a doubt right before payment.