Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kieckhafer
Copy link
Member

@kieckhafer kieckhafer commented Mar 6, 2019

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.
image

Solution

Add a recalculation of the subtotal inside addItemsToCart util.

Testing

  1. Start reaction-platform
  2. Add any quantity of items to a cart
  3. See the subtotal is correct in the mini-cart dropdown
  4. Add any number of the same items to the cart
  5. See that the subtotal has updated and the calculation is correct
  6. Also see that subtotal is correctly calculated when using +, - and remove buttons inside the cart itself
    price updates mov

@kieckhafer kieckhafer changed the base branch from master to develop March 6, 2019 06:34
@kieckhafer kieckhafer changed the title Fix kieckhafer updated subtotal when items added to cart fix: item subtotal is incorrect when additional quantities of same item are added to cart Mar 6, 2019
Signed-off-by: Erik Kieckhafer <[email protected]>
@kieckhafer kieckhafer requested review from aldeed and jamesporl March 6, 2019 06:44
@kieckhafer kieckhafer marked this pull request as ready for review March 6, 2019 06:45
@aldeed aldeed merged commit a8a85d5 into develop Mar 6, 2019
@aldeed aldeed deleted the fix-kieckhafer-updatedSubtotalWhenItemsAddedToCart branch March 6, 2019 23:49
@jeffcorpuz jeffcorpuz mentioned this pull request Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants