-
Notifications
You must be signed in to change notification settings - Fork 2.1k
add lazy create cart token #3994
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
add lazy create cart token #3994
Conversation
pkarw
left a comment
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.
-
After user logs in we need to sync the shopping cart - you removed
authorizefrom the user actions and I'm not sure if it's called when user authorizes him/her self? -
I'd rename
createCartTokentoauthorizeas it does exactly the same way but I'd say kind of "lazy way" ... wdyt? I don't likecreateCartTokenit should be one-word name likecreate(if we won't stay withauthorize)
|
You are right. I revert |
|
After latest changes, I tested both scenarios with annonymous and logged-in customer. Behavior is consistent with your description (note:in scenario 2 for logged-in user, cart is created in the moment of logging in, even if customer have no products in it) In the meantime, we discovered unrelated problem with cart sync in some specific cases. Will be reported separately in: #3995 |
pkarw
left a comment
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.
Two minor comments added. Please check twice if the cart/create requests aren’t multiplied
|
@gibkigonzo can you fix the tests? |
|
@andrzejewsky done 👌 |
|
I've made one more update d3debc4 |
|
@gibkigonzo and... again... changelog... 😄 |
|
@andrzejewsky done 😅 |
Short Description and Why It's Useful
This allows to create cart token when user add product to cart. There is edge case: when user load page, go to offline, add product, go to checkout => can't make order. That's because he hasn't got payment methods which are loaded after token creation. Also I've added refresh payment methods in checkout. Right now in demo if somehow user get to checkout without loaded payment-methods then he can't make order, even if he get back online
QA
A.
B.
Same can be checked with user logged in.
Which Environment This Relates To
Check your case. In case of any doubts please read about Release Cycle
developbranch and want to merge it back todevelopreleasebranch and want to merge it back toreleasehotfixormasterbranch and want to merge it back tohotfixUpgrade Notes and Changelog
IMPORTANT NOTICE - Remember to update
CHANGELOG.mdwith description of your changeContribution and Currently Important Rules Acceptance