Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Key points of realization of shopping cart

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

First, shopping cart module

1.1 the difference between the two ways to implement a shopping cart:

Save with session

Cons: the browser is closed and the shopping information saved in session when session fails will disappear.

In the follow-up optimization, the purchase information will not only be saved in session, but also be purchased.

The product information is saved in cookie, which solves the problem of browser shutdown or computer shutdown.

The problem of the loss of information on the purchase of goods (but can not solve the problem of the loss of information in the swap computer).

Advantages: do not have to operate the database, you can reduce the pressure of database access.

In the database:

Cons: only logged-in users can add shopping carts.

Operate the database frequently.

Advantages: the browser is closed and the replacement of the computer will not be affected.

two。 Order module

2.1 when the order is added successfully, the inventory of the corresponding goods should be reduced.

2.2 the connection of multiple tables will be designed, which requires relatively high operation of the database.

Note: the document has corresponding implementation ideas.

Attachment: http://down.51cto.com/data/2368284

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 269

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report