Hi guys,
I'm having a bit of a problem here, while coding a php eShop from scratch. Everything went fine so far, but now I have the following situation with stock implementation:
Stock system works OK - when a user ads a product, the amount of items on stock decreases, when a user updates his cart, the amount of items on stock changes appropriately.
When a user has some items in his cart, the amount of those items is already subtracted from the total stock of that product so that two persons can't buy the same ticket. If the user logges off without buying those products, those products are "returned" to stock - in other words, the amount of items on stock increases again.
BUT if a user closes his browser, while having items in his cart, those products remain "used" and the stock stays decreased by those items eventhough the user went away.
HOW can I make sure that the amount of tickets on stock gets back up if the user goes away without buying the "reserved" products and without his input???
Please give me some ideas as this is urgent..
Many thanks in advance!