bradtraversy / proshop_mern

Shopping cart built with MERN & Redux
2k stars 1.18k forks source link

About CartItems #133

Closed ramit0407 closed 3 years ago

ramit0407 commented 3 years ago

After getting logout from the page, all the items that were present in cart do not appear in the next login. How can we resolve this issue?

basir commented 3 years ago

hello there, we did it intentionally because after logout we need to clear user data including selected items in the shopping cart here: https://github.com/bradtraversy/proshop_mern/blob/master/frontend/src/actions/userActions.js#L67 if you want to keep them just remove that line.

ramit0407 commented 3 years ago

If we remove that line then if i login with different username, cart has products which do not belong to this username.

talmax1124 commented 3 years ago

@basir Is there a way to save the cart items into a user's cart, so like if they move between devices they don't have to add to cart again? If so, can you provide a example, link, or PR.