-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Problem
If a user is not logged in and they add items to their cart, when they proceed to checkout, they are prompted to log in. Once logged in, the cart they had when they were not logged in is lost.
Expected outcome
The guest cart should be merged with the customer cart. Eg, if orderOptions.mergeStrategy in vendure-config.ts is UseGuestStrategy, the customer cart should be replaced with the guest cart.
Possible fix
In /apps/storefront/src/app/sign-in/actions.ts, the mutate call in loginAction does not make use of the guest auth token. Adding the token allows for the carts to be merged:
const result = await mutate(LoginMutation, {
username,
password,
}, { useAuthToken: true });Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels