fix: isCartUserGuest - Incorrect user email information definition in multi-site #20200
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In multi-site projects, the uid information in cart.user includes the user's email along with the baseSite information.
For example: 7c867be3-d7c6-442b-aff9-7f1c315ee838|[email protected]|apparel-uk
In the isCartUserGuest function in activeCartService, the user's email is checked as "[email protected]|apparel-uk" for the isEmail check. Since the email address contains the "|" character, the isEmail function returns false. After the credit card is saved in the Guest checkout steps, the "cart.user.name" value changes. Since the isEmail function also returns false, checkout.guard cannot be passed and the user needs to set the email again. However, since the email is already set, the user receives an error while setting the email again and cannot continue with the process.