Description:
Shopping is often a shared experience, but traditional carts are isolated to a single session. Adding a "Collaborative Cart" feature would allow users to generate a shareable link so friends or family can add items to the exact same cart in real-time, greatly enhancing the social aspect of the platform.
Proposed Implementation:
Backend: Create a new Socket.io event namespace for carts. Generate a unique cartRoomId when a user clicks "Share Cart".
Frontend: Extract the roomId from the URL and emit a joinCartRoom event upon entry.
State Sync: Hook our existing Zustand useCartStore into the socket listeners. Whenever any user in the room triggers addToCart, broadcast it to the room and instantly update the Zustand state for all connected peers.
@niharika-mente could you plz assign this to me?
Description:
Shopping is often a shared experience, but traditional carts are isolated to a single session. Adding a "Collaborative Cart" feature would allow users to generate a shareable link so friends or family can add items to the exact same cart in real-time, greatly enhancing the social aspect of the platform.
Proposed Implementation:
Backend: Create a new Socket.io event namespace for carts. Generate a unique cartRoomId when a user clicks "Share Cart".
Frontend: Extract the roomId from the URL and emit a joinCartRoom event upon entry.
State Sync: Hook our existing Zustand useCartStore into the socket listeners. Whenever any user in the room triggers addToCart, broadcast it to the room and instantly update the Zustand state for all connected peers.
@niharika-mente could you plz assign this to me?