proshop_django
proshop_django copied to clipboard
About cart items
Thanks for providing this course i am grateful to you but i found one issue on this course. The issue is: when ever one user add items to the cart each and every users have the same item to their cart so please can you provide the solution for this solution
Hey diplovkhatri, you can just add this localStorage.removeItem('userInfo'); localStorage.removeItem('cartItems'); localStorage.removeItem('shippingAddress'); localStorage.removeItem('paymentMethod');
This will be in src/actions/userActions.js. Just look for export const logout = () => (dispatch) => { and add the rest! You can look at brads github since dennis sucks. https://github.com/bradtraversy/proshop_mern/blob/master/frontend/src/actions/userActions.js keep in mind don't just copy everything something will break so you have to look at the difference in the code but everything should work fine!
Thank you for your reply. I did the same things what you said but it didn't seems to be working . only 'shipping Address' and 'payment Method' seems to be removing from 'local storage' but 'cart Items' seems to remaning same and after i login from another account there is nothings just blank to local storage so that i should enter shipping address for every accounts .I didn't find whats going wrong with this
Thank you for your reply. I did the same things what you said but it didn't seems to be working . only 'shipping Address' and 'payment Method' seems to be removing from 'local storage' but 'cart Items' seems to remaning same and after i login from another account there is nothings just blank to local storage so that i should enter shipping address for every accounts .I didn't find whats going wrong with this
If you want send me a link of your github or screenshot or look at the github I sent you and compare your code!