adrianhajdin / ecommerce_sanity_stripe

Modern Full Stack ECommerce Application with Stripe
https://jsmastery.pro
2.21k stars 674 forks source link

Implemented the use of local storage for cart products. #81

Closed ghost closed 1 year ago

ghost commented 1 year ago

You forgot to show the implementation of local storage in your tutorial.

I gave it a shot and got it working with the following code, though I'm sure there's better ways of doing this, as I'm no expert in React or Next.js

baberparweez commented 1 year ago

Seems to work fine. Well done and thank you for your contribution 👍

DigiDigiblez commented 1 year ago

@baberparweez Hi man. Please can I have the code for the localstorage fix? The account who posted the fix is deactivated, I cannot access the commit from here. Cheers!

baberparweez commented 1 year ago

Hi @DigiOfficial please try these snippets. They are from what was originally shared. Let me know if the code works for you.

Screenshot 2023-01-24 at 11 38 34

Screenshot 2023-01-24 at 11 40 47