M
M
magary42017-11-24 11:20:32
Software design
magary4, 2017-11-24 11:20:32

What should I do if an item in my shopping cart is no longer available?

The user puts the item in the shopping cart. When an hour later the user decides to checkout, the product has already become unavailable.
Also, if the product becomes unavailable, for example, after 10 minutes, the user continues to see the product in the cart for the next 50 minutes.
How cleverly is this implemented in serious projects?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Grishin, 2017-11-24
@magary4

And they realize it - "ate while you were stupid." And they show an error when checking out "this product is no longer available", if there is information, then you can indicate when the last item was ordered.

M
Maxim Timofeev, 2017-11-24
@webinar

how is it implemented in the mind in serious projects?

Availability of goods is checked before payment. In addition, you can also check before loading the cart page. When added to the cart, the balances are not written off and nothing like this happens. Treat the shopping cart like a wish list and nothing more. But placing an order is another story. This is the intention to buy. Here we are already checking the balances, writing off the balances, etc. We use transactions to ensure data integrity.

S
sim3x, 2017-11-24
@sim3x

in one hour
for a registered user they can book
But not for an hour.
1-5 minutes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question