Change the price in the basket

Say I have a laptop for 600.00. Let's say I change it for $ 650. How do shopping baskets do it? How do they store the price in a basket or item? How do they make sure that they get the desired price, but do not expose the customer a new change without asking them? Or do most store them in both?

I thought maybe I could keep it in both. Therefore, if the current price exceeds the price of a basket for a product, do not remove it / do not set it out of the basket. Then, inform them that a receipt has been set / sent by e-mail for items that have not changed, what has been set (say, they had more than one item) and remove it from the basket. For items that have changed, say something like “Items left in the basket due to a change in price, please check if you still want to buy items at a new price.” Therefore, leave the items that have been changed in the basket, but update the price in the basket.

Here is my idea on how to do this. I do not think language should matter. Guess this is more of a logical type question. Do most shopping carts do this or is there a better way?

+3
source share
3 answers

Simple shopping carts are just arrays of products that are supported through sessions and cookies. You can do whatever you want. Just make sure that users cannot do whatever they want, such as changing prices by URL. But above all, making it very, very, very easy for the user to check.

, , - , . , , , , , , , , , .

, , , cookie/ , .

, , , , , LineItem, , , .

, , , , , , . , , x, .

+2

, , .

, , , . , , "" .

. , , , . , 1200 , , $0, "Bad Thing".

$1200 -  $ 600 - - $600 -  $ 0 - ?

, , , , - 600,00 , " ".

- , / , (, ..) . , "" "", , ​​ " ".

OWASP , , . http://www.owasp.org

+2

If the basket simply contains a link to an element (for example, id / primary key), you do not need to store the price in two places. You simply load objects from the basket when you need them, and prices automatically reflect this change. In most cases, the changes will be infrequent, and this is not very important from the point of view of the user.

0
source

Source: https://habr.com/ru/post/1776042/


All Articles