亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Objective-c - Local caching of shopping cart
曾經(jīng)蠟筆沒有小新
曾經(jīng)蠟筆沒有小新 2017-05-02 09:26:04
0
2
845

Let me ask you, in a shopping app, which method is used to cache the shopping cart locally, what scenarios are used, and what kind of data is cached? Thanks!

曾經(jīng)蠟筆沒有小新
曾經(jīng)蠟筆沒有小新

reply all(2)
巴扎黑

Not logged in: save the cookie when adding to the shopping cart, and the shopping cart displays the cookie content
After logging in: when logging in, take the cookie and save it to the database shopping cart table, handle the duplication of cookies and tables, clear the cookies, and the shopping cart displays the contents of the table. Save it directly to the table when adding to the shopping cart

As for the stored data, it depends on the design of the product. The necessary ones include: product id, purchase quantity, and product attributes selected by the user (if any). If the product is deleted and only a field is changed, these data should meet the needs. There are more user IDs in the table than cookies
Another note: If the record is really deleted when the product is deleted, you can consider storing multiple product names, product pictures, etc.

黃舟

Just cache the user’s shopping information

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template