We don't have anything built in for this so it would require some custom development.
Best approach I could think of would be to create a custom in memory cache storing the an order id + product ref + qty and then combining this with your product page logic to define the stock as being the stock level on record - whatever is in the memory cache. You'd then need some kind of sliding expiration on the cache.
You should be able to hook into events to know when something is added to cart and you could also create some custom validation handlers to prevent an item being added if the cumulative stock level goes below 0.
Can stock change when added to cart
Hi,
If a customer adds an item to cart, can I change the stock? Or have some kind of shadow-stock?
Like.. When somebody else adds it to their shopping cart, it reduces the stock for two hours until buying?
Hi Sibren,
We don't have anything built in for this so it would require some custom development.
Best approach I could think of would be to create a custom in memory cache storing the an order id + product ref + qty and then combining this with your product page logic to define the stock as being the stock level on record - whatever is in the memory cache. You'd then need some kind of sliding expiration on the cache.
You should be able to hook into events to know when something is added to cart and you could also create some custom validation handlers to prevent an item being added if the cumulative stock level goes below 0.
Hope this helps
Matt
is working on a reply...