处理结账流程数据
我目前正在开发一个小型电子商务应用程序,以帮助我掌握 CodeIgniter 和一般编程。
我有一个 4 步结账流程。
- 客户姓名、电子邮件、送货国家/地区
- 送货选项、送货地址
- 账单选项、账单地址
- 查看并提交
目前我将所有这些数据存储在会话中(现在是 cookie,实时时是 db)作为 JSON 编码数组。
我想知道,我是否最好将信息存储在链接到购物车项目的订单表中,以便我可以跟踪废弃的购物车(内容,用户退出时的步骤),或者只是将其保留在会话中,并在他们确认时将其全部转移评论页面。
我正在尝试掌握一些可供我选择的选项。
I am currently developing a little ecommerce application to help me get to grips with CodeIgniter and programming in general.
I have a 4 step checkout process.
- Customer name, email, shipping country
- Shipping option, shipping address
- Billing option, billing address
- Review and submit
Currently I am storing all this data in the session (cookie for now, db when live) as a JSON encoded array.
I was wondering, am I better off storing the information in the order table linked to cart items so that I can track abandoned carts (contents, step when user exited) or just retaining it in the session and transferring it all when they confirm on the review page.
I am trying to get to grips with some of the options available to me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于您计划如何使用数据。如果您要创建功能来挖掘有关用户购物习惯的数据(包括废弃的购物车),那么一定要将该数据保留在数据库中。如果您认为这种情况不太可能发生,那么存储它对您没有任何好处,而且是不必要的信息。但只有在您确定永远不需要该信息时才丢弃该信息。听起来您可能想在将来的某个时候探索废弃的购物车报告,因此现在存储数据(尽管不会立即挖掘)可能是一个好主意。
It depends on how you plan to use the data. If you're going to create functionality to mine data on your users' shopping habits, including abandoned carts, then definitely retain that data in a database. If you don't think that is likely to happen then storing it doesn't do you any good and is unnecessary information. But only discard that information if you're sure you're never going to need it. It sounds like you may want to explore abandoned cart reporting at some point in the future so storing the data now, although it won't be mined right away, is probably a good idea.