Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ecommerce::Shopping cart::Where should i store shopping cart data in session or in database [closed]

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

like image 449
Yosef Avatar asked May 13 '10 14:05

Yosef


People also ask

Which object should you use to store the shopping cart data in html5?

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.

How does an ecommerce shopping cart work?

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.

How are shopping carts important in e commerce websites?

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.


1 Answers

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.

  1. 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.

  2. 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

enter image description here

like image 143
Musa Avatar answered Sep 28 '22 23:09

Musa