fix: item subtotal is incorrect when additional quantities of same item are added to cart #5021
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.
Resolves reactioncommerce/example-storefront#462
Impact: major
Type: bugfix
Issue
Adding additional quantities of an item that is already in your cart does not trigger a subtotal recalculation, leaving the numbers in the cart preview incorrect. For example, the following image, 1 item was added, then as a second action, another item was added to the cart. The subtotal should be $39.98 ($19.99*2), but it still displays $19.99.

Solution
Add a recalculation of the
subtotalinsideaddItemsToCartutil.Testing
reaction-platform+,-andremovebuttons inside the cart itself