Feature/save for later cart#377
Open
Suhaskumard wants to merge 5 commits into
Open
Conversation
|
@Suhaskumard is attempting to deploy a commit to the niharika-mente's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Hi @niharika-mente @Aamod007, |
Aamod-Dev
approved these changes
Jun 21, 2026
Aamod-Dev
left a comment
Collaborator
There was a problem hiding this comment.
Looks good, approved!
Aamod-Dev
requested changes
Jun 21, 2026
Aamod-Dev
left a comment
Collaborator
There was a problem hiding this comment.
Needs changes: There are merge conflicts. Please resolve them.
Author
|
Hi @Aamod007, |
Author
|
Hi @Aamod007, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR introduces a robust "Save for Later" functionality within the shopping cart, allowing users to effortlessly move items out of their active cart without permanently deleting them.
The implementation bridges the gap between guest users and authenticated users by offering instant
localStoragepersistence that smartly synchronizes with the backend database upon login, ensuring a seamless and clutter-free shopping experience.Closes #295
Type of Change
Checklist
Changes Made
Guest Mode Support (Local Storage)
Implemented a frontend state manager utilizing Zustand's
persistmiddleware to handle "Save for Later" items for unauthenticated users.The Guest Mode:
localStorageAuthenticated Database Persistence
Designed a dedicated backend infrastructure to track saved items for logged-in users.
The Authenticated Mode:
SavedForLater)Smart Synchronization System
Integrated a synchronization hook that executes upon successful login to bridge guest and authenticated states.
The synchronization logic:
localStorageInteractive Cart Drawer UI
Enhanced the cart drawer experience to seamlessly integrate the new feature.
Enhancements include:
Ghost Product Bug Fix
Resolved a critical issue where the frontend could fail if a saved product was removed from the inventory by an administrator.
The fix:
Files Added
Backend
SavedForLatermodelsavedForLater.controller.jssavedForLater.route.jssavedForLater.test.jsFrontend
useSavedForLaterStoreFiles Updated
Navbar.jsxLogin.jsxapp.jsUser Experience Improvements
Improved Cart Management
Users are no longer forced to either purchase an item immediately or remove it entirely.
Instead:
Consistent User Feedback
Actions provide immediate visual confirmation through UI updates and notifications, improving responsiveness and clarity.
Seamless Guest-to-User Transition
Users can begin shopping as guests, save products, and later sign in without losing their saved items.
How Has This Been Tested?
Backend Validation
Verified:
Synchronization Testing
Verified:
UI & Edge Case Testing
Covered scenarios including:
Acceptance Criteria
Technical Notes
useSavedForLaterStoreimplementation leverages Zustand'spersistmiddleware to maintain local persistence independently from UI components.Demo Video
This demo showcases the newly implemented Save for Later functionality and synchronization workflow.
The video demonstrates:
The implementation improves cart organization, enhances shopping flexibility, and provides a seamless experience for both guest and authenticated users.