问题描述
我正在为我的项目创建一个电子商务网站.我完成了大部分内容,但对一个主题感到困惑.如何保存用户当前的购物车数据?
我认为,如果我在数据库中创建了一个表,并且购物车中的商品一直保存在该表中,直到订单完成.然后,我可以从购物车表格中删除该商品.在这种情况下,如果用户在不下订单的情况下退出并稍后进入站点,则他的购物车不会丢失,并且会继续购物.
这是一种好的编程方式(我是说有效的)还是应该使用类似memcache的东西?
谢谢,
Hi,
I am creating an e-commerce website for my project. I completed most of it, but confused about one topic. How can I keep current shopping-cart data of user?
I think that if I created a table in database and shopping cart items are kept in that table until order finishes. Then, I can delete that item from the shopping cart table. In this case, if the user quits without giving order and enters the site later, his shopping cart will not be lost and he will continue his shopping.
Is this a good programming way(I mean efficent) or should I use something like memcache?
Thanks,
推荐答案
这篇关于电子商务网站中的购物车的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!