-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Core] Maintain previous cart after logging in #6904
[Core] Maintain previous cart after logging in #6904
Conversation
89f7677
to
24780d2
Compare
try { | ||
$channel = $this->channelContext->getChannel(); | ||
} catch (ChannelNotFoundException $exception) { | ||
return; |
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.
throw new CartNotFoundException
?
throw new CartNotFoundException('Sylius was not able to find the cart, as there is no logged in user.'); | ||
} | ||
|
||
$cart = $this->orderRepository->findLatestCartByChannelAndCustomer($channel, $customer); |
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.
We should return only one cart. Can't we use getOneOrNullResult
?
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.
Well, sure we can! 🐃
5f322f0
to
98c4e53
Compare
Thank you Mateusz! |
This PR solves two issues: