Where should I store shopping cart data in session or in database? (I think in amazon.com shopping cart after user logout and after month login again his orders that he choose in shopping cart saved) Thanks, Yosef
localStorage: One of the scenarios for using localStorage is saving a product that the user places in their shopping cart. It can be accessed between multiple browser tabs, page requests, and even between browser sessions.
An online shopping cart is software that makes it possible for customers to select products and buy them online. In a brick-and-mortar setting, a customer could browse, grab a product off the shelf, and head to the checkout counter to make a purchase.
A shopping cart in ecommerce is a type of software that allows customers to purchase items from your shop or store a list of the items they wish to purchase in the future.
Of course shopping cart data is a critical data. Where to save this data it depends on that user which your e-commerce system works.
With Not Signed (yet) users - You have to save this data on web storage, html5 gives you ability for this.Simple using Front End Storage, which equips any Browser (Cookie, Session Storage, Local Storage). On checkout process system must require sign up from user. After sign up you have to synchronize this data with Database. Otherwise you have not to save this untraceable data on Database.
With Signed users - of course in Database. With this way you can correctly trace Basket of user. If user will sign in from any where you can show her his account and "items for pending payment". And saving this data on Browser storage it depend on your taste.
this information may be helpful too Client side vs server side shopping card storage
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With