如何在在线站点中添加到mycart? [英] How does add to mycart work in online sitr?

查看:87
本文介绍了如何在在线站点中添加到mycart?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我,我是一名学生,我想建立一个在线购物asp网站.

please help me i am a student and i want to make a online mall shopping asp site.

推荐答案

有两种基本方法:

1)根据用户(如果已登录)或会话(如果未登录)将选择存储在数据库中
2)将选择存储在客户端的Cookie中.

您可以结合使用这些来为非注册用户生成一个临时用户,该用户的ID存储在cookie中,而存储在数据库中的选择与该用户相对.

我?我可能会选择组合方法,以保留产品信息服务器端.
There are two basic ways:

1) Store selections in a database against a user (if logged in) or session (if not)
2) Store selections in cookies on the client.

You can combine these to produce a temporary user, whose ID is stored in a cookie, against selections stored in a DB, for non-registered users.

Me? I''d probably go for the combined approach, to keep the product info server side.


您需要为购物车创建一个表,其中包含用户在中选择的产品详细信息在此表中,应将产品ID和用户ID用作外键.服务人员单击添加到购物车"选项时,应在此表中进行输入.整个过程完成后,应将这些条目从此表中删除,因为条目需要落入sold_items表中.

这只是如何实现的概述.根据您的项目要求,应记住更多需要注意的东西,即您需要保持正确的产品数量和已售商品清单等.
you need to create a table for shopping cart which contain the product details selected by the user , in this table the product id and userid should be used as foreign key. entries should be made in this table when the ser clicks the add to cart option. Once the whole process is complete the entries should be deleted from this table as the entries need to fall in sold_items table.

This is just an overview of how it can be implemented. Many more need things should be kept in mind depending on your project requirements i.e you need to maintain the proper count of products and the sold items list and many more.


Table-OrderTable(OrderId, CartId(Cookie),UserId,OrderDate,OrderStatus)
OrderDetails表(OrderdetailsId,Itemid,Quantity,Orderid)
这两个表是存储客户订单明细的基础,

工作流程是

当用户选择一个项目时,它将被添加到购物车并填充订单表,并且购物卡cookie必须具有值,
订单明细表中将添加一个订单项.

因此,如果您关闭浏览器并通过cookie再次打开,您将检查打开状态顺序是否存在,
然后您将从orderdetails中读取所有值并填充到购物车详细信息页面
Table-OrderTable(OrderId,CartId(Cookie),UserId,OrderDate,OrderStatus)
OrderDetails table(OrderdetailsId,Itemid,Quantity,Orderid)
These two tables are the besic to store the order details against of customer,

the workflow is

While user select a item, then it will be added to a cart and order table will be populated and shopping card cookie must have value,
and one line item will be added in the order Details table.

so if u close the browser and open again by cookie u will check the open status order is there,
then u will read all the values from orderdetails and populated to the cart details page


这篇关于如何在在线站点中添加到mycart?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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