-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to reserve & expire quantity when adding items to the cart? #147
Comments
Can you elaborate more on the expire part? What exactly do you mean by "expiring the cart" and how will the timeout be renewed? Out of my head and assuming i am correctly understanding the question i would do something like the following:
Maybe you could also do this by using the service container. |
Sir actually the scenario is this : I am using this package for a canteen system to order items. My requirement was upon adding to cart, my stock gets reduced. So, if one person adds to the cart and goes idle, the item would be reserved for until session expires. That's why I need to expire the cart in 5 minutes and invoke a action that could restock the items. I am planning to move ahead with the database part as you said. |
There is one issue with this that comes to my mind: The cart content is stored in the session or in the database (in a single row) so you can not do a query to determine the correct, avaliable qty to display on the product page. If the content of the cart was DB only the available qty would simply be |
@bumbummen99 sir I thought of a workaround : So, I am planning to remove cart from the session data located inside storage/framework/sessions___ file. Problem is I stored the session_id of the user and everything is working well, I am having trouble retreiving user's session data based on the session_id, could you suggest any mechanism for this?
|
For some reasons, I have a requirement of expiring the cart in 5 minutes. I didnt find it in config/cart.php.
Is there any option for this?
The text was updated successfully, but these errors were encountered: