Get the App
SLTechnology News&Howtos  ›  Database  › 

Key points of realization of shopping cart

Shulou Source: shulou.com Published: 2022-06-01 11:03:44 11月16日 Update

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

Tags: Information data database shopping goods shopping cart browser computer browsing advantages modules disadvantages orders problems frequency success no use pressure multiple inventory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information MariaDB Redmi Apple Shulou Technology