Preconditions and environment
- Magento Open Source 2.4.9 (also present on current
2.4-develop)
- Store configuration:
Stores > Configuration > Sales > Tax > Shopping Cart Display Settings > Display Prices = Including Tax (tax/cart_display/price = 2)
Display Subtotal = Including Tax (tax/cart_display/subtotal = 2)
- Luma or any theme that uses
Magento_Checkout/js/cart/ensure-subtotal-sync (wired from cart/form.phtml)
Steps to reproduce
- Set cart price / subtotal display to Including Tax (values above) and flush config + full page cache.
- Add any simple product to the cart.
- Open
/checkout/cart/ and wait for Knockout cart totals to render.
- In the browser Network panel, filter for
checkout/cart.
Expected result
No automatic full-page cart HTML reload after paint when the table row subtotals already match the summary subtotal.
Actual result
The browser issues a redundant:
GET /checkout/cart/?ajax=1&_=<timestamp>
Magento_Checkout/js/cart/ensure-subtotal-sync sets body.cart-synced = true and replaces #form-validate.
Additional information
Root cause
getCentralSubtotal() only sums:
'#shopping-cart-table .col.subtotal .price-excluding-tax .cart-price'
With including-tax display, Magento's row price template renders .price-including-tax .cart-price and does not render .price-excluding-tax. The central sum stays 0, the summary subtotal is non-zero (e.g. $22.00), so trySync() always treats the cart as out of sync and reloads the cart HTML once.
Confirmed locally: with tax/cart_display/subtotal = 2, excl-tax nodes are empty, incl-tax nodes match the summary, and Magento still fires ?ajax=1.
Suggested fix
Prefer excl-tax prices when present (both-prices mode), otherwise fall back to incl-tax, then bare .cart-price.
File: app/code/Magento/Checkout/view/frontend/web/js/cart/ensure-subtotal-sync.js
Release note
Shopping cart no longer issues a redundant AJAX reload when cart prices are displayed including tax.
Triage and priority
Preconditions and environment
2.4-develop)Stores > Configuration > Sales > Tax > Shopping Cart Display Settings > Display Prices= Including Tax (tax/cart_display/price = 2)Display Subtotal= Including Tax (tax/cart_display/subtotal = 2)Magento_Checkout/js/cart/ensure-subtotal-sync(wired fromcart/form.phtml)Steps to reproduce
/checkout/cart/and wait for Knockout cart totals to render.checkout/cart.Expected result
No automatic full-page cart HTML reload after paint when the table row subtotals already match the summary subtotal.
Actual result
The browser issues a redundant:
GET /checkout/cart/?ajax=1&_=<timestamp>Magento_Checkout/js/cart/ensure-subtotal-syncsetsbody.cart-synced = trueand replaces#form-validate.Additional information
Root cause
getCentralSubtotal()only sums:'#shopping-cart-table .col.subtotal .price-excluding-tax .cart-price'With including-tax display, Magento's row price template renders
.price-including-tax .cart-priceand does not render.price-excluding-tax. The central sum stays0, the summary subtotal is non-zero (e.g.$22.00), sotrySync()always treats the cart as out of sync and reloads the cart HTML once.Confirmed locally: with
tax/cart_display/subtotal = 2, excl-tax nodes are empty, incl-tax nodes match the summary, and Magento still fires?ajax=1.Suggested fix
Prefer excl-tax prices when present (both-prices mode), otherwise fall back to incl-tax, then bare
.cart-price.File:
app/code/Magento/Checkout/view/frontend/web/js/cart/ensure-subtotal-sync.jsRelease note
Shopping cart no longer issues a redundant AJAX reload when cart prices are displayed including tax.
Triage and priority