I need Help on how to expire a shopping cart
Suppose we have a shopping cart in a e-commerce website, and a user adds a product to his shopping cart the problem is that from the inventory we should decrement the quantity of that product because it’s being held by a user.
The idea is we implement a timer in the shopping cart when that timer expires, the user doesn’t hold that product anymore.
My questions are :
- How to implement a timer that will work across all pages in the website
- How to trigger the event of updating the inventory once the timer is done.
Hope my explanation was clear. Thank you for your time.