[Backport] Reload cart totals when cart data changes #18984
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original Pull Request
#18700
Description (*)
When cart data changes on cart view, the totals need to be reloaded. For example, when the qty changes, the totals of the cart data change as well.
This normally doesn't happen in default Magento, because cart mutations reload the entire page. I stumbled upon this problem when creating an extension that allows the customer to change qty without reloading the page.
Manual testing scenarios (*)
I can't really provide steps to reproduce my situation, because core Magento doesn't do javascript cart mutations on the cart view. But, when adding items to cart, the totals should be rendered properly. This change shouldn't affect the usual totals estimation. So here you go:
Contribution checklist (*)