-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix duplicate shipping methods in first checkout #2880
Fix duplicate shipping methods in first checkout #2880
Conversation
This works and I am going to merge it but maybe you can help me understand the problem and why this fixes it better. |
@@ -34,6 +34,23 @@ function getShippingRates(previousQueryResults, cart) { | |||
return previousQueryResults; | |||
} | |||
} | |||
if (!(cart.shipping && cart.shipping[0] && cart.shipping[0].address)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of our goals was to eliminate these hard-coded 0th indexes - I'm a bit concerned about introducing these here as it seems like adding technical debt immediately
The reason why this fixes the bugs is that, on the first ever checkout, Much of the same argument also applies to when |
Unfortunately I don't think that assumption is always correct. If a user has checked out and has selected a default address before it immediately attaches the address to the cart as soon as it is created. |
Are you saying a user can have a saved address, and thus have a non-empty |
Resolves #2866.
This PR fixes a bug in the checkout process. Previously, the very first time you checkout (after a
reaction reset
or a fresh installation of Reaction), you get duplicate instances of flat rate shipping methods. This PR fixes that.Test Instructions
Part 1:
reaction reset
Part 2: