电子商务::购物车::我应该在会话或数据库中存储购物车数据的位置 [英] Ecommerce::Shopping cart::Where should i store shopping cart data in session or in database

查看:362
本文介绍了电子商务::购物车::我应该在会话或数据库中存储购物车数据的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该在会话或数据库中的哪个位置存储购物车数据? (我认为在用户注销后在amazon.com购物车中,并且在一个月后再次登录后,他在购物车中选择的订单已保存) 谢谢, 优素福

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

推荐答案

当然,购物车数据是关键数据.在何处保存此数据,取决于您的电子商务系统可以使用的用户.

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. (尚未)用户-您必须将这些数据保存在Web存储上,html5可以实现此功能.使用前端存储简单易行,前端存储可配备任何浏览器(Cookie,会话存储,本地存储) .在结帐流程中,系统必须要求用户注册.注册后,您必须将此数据与数据库同步.否则,您不必将这些无法追溯的数据保存在数据库中.

  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.

具有签名用户-当然在数据库中.通过这种方式,您可以正确跟踪用户的购物篮.如果用户从任何可以登录的地方登录,您都可以向他显示他的帐户和待付款项".并将此数据保存在浏览器存储中取决于您的喜好.

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

这篇关于电子商务::购物车::我应该在会话或数据库中存储购物车数据的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆