You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
In our Frontend, currently, users can add items to their shopping cart even if they are not logged in. This shopping cart is stored in the user's cookies. However, when a user attempts to checkout, they are prompted to either log in or register an account.
This feature request involves modifying our login/registration processes to handle cases where the user has items in their anonymous cart. When the user logs in or registers, any items in their anonymous cart should be transferred to their backend shopping cart associated with their account. This will allow the checkout process to commence.
Expected Behavior
When an anonymous user (no account or not logged in) adds items to their cart, the items are stored in their cookies.
When this user then chooses to log in or register, the system should detect the presence of items in their cookie-stored cart.
Upon successful login or registration, if the user's account does not have an existing shopping cart, one should be created.
The items from the anonymous cart should be added to the user's backend shopping cart associated with their account.
If the user had items in their backend cart prior to this login/registration, the new items should be merged with the pre-existing ones.
Once the items have been transferred, the anonymous cart should be cleared from the cookies.
The user can now proceed with the checkout process.
Acceptance Criteria
An anonymous user can add items to the shopping cart.
If the user logs in or registers, the system identifies any items in the cookie-stored cart.
If the user does not have a shopping cart in the backend, one is created.
The items from the anonymous cart are added to the user's backend cart upon login/registration.
Items previously existing in the backend cart are not lost or overwritten, but merged with the new items.
(The cookie-stored cart is cleared after the transfer.)
The user can successfully begin the checkout process with all the items in their backend cart.
Implementation Details
Update the login/register routes to check for the presence of a cookie-stored cart upon user login/registration.
If such a cart exists, iterate over its contents and add each item to the user's backend shopping cart.
If a backend shopping cart does not exist for the user, create one.
Handle cases where the same item might exist in both the anonymous and backend carts.
After successfully transferring the items, clear the cookie-stored cart.
Testing
Test the updated login/registration routes with and without an anonymous cart present.
Test cases where the same item exists in both carts to ensure items are merged correctly.
Confirm that after transferring items, the anonymous cart is cleared.
Test the creation of a new shopping cart if one does not exist for a user.
Additional Notes
This feature is important for ensuring a seamless shopping experience for our users. By preserving the contents of their cart across sessions and even before they have an account, we are minimizing friction in the purchasing process and potentially increasing sales. As such, the implementation of this feature should be given a high priority.
The text was updated successfully, but these errors were encountered:
Description
In our Frontend, currently, users can add items to their shopping cart even if they are not logged in. This shopping cart is stored in the user's cookies. However, when a user attempts to checkout, they are prompted to either log in or register an account.
This feature request involves modifying our login/registration processes to handle cases where the user has items in their anonymous cart. When the user logs in or registers, any items in their anonymous cart should be transferred to their backend shopping cart associated with their account. This will allow the checkout process to commence.
Expected Behavior
Acceptance Criteria
Implementation Details
Testing
Additional Notes
This feature is important for ensuring a seamless shopping experience for our users. By preserving the contents of their cart across sessions and even before they have an account, we are minimizing friction in the purchasing process and potentially increasing sales. As such, the implementation of this feature should be given a high priority.
The text was updated successfully, but these errors were encountered: