Are items in cart reserved for xx amount of time - or is a race to the finish?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
I am trying to determine when inventory is accounted for in the shopping process. Many ecommerce systems don't adjust inventory until the order has been processed. I need a solution where if the customer puts an item in their cart, they are guaranteed that item for at least a few minutes until they check out.

How does NopCommerce handle this?


[Sample scenario]
I have a ProductOne with an inventory of 1.

If customerA puts this in their cart, can customerB also put those items in their cart prior to customerA checking out?

Supposing that were true, and if customerB checks out first - what message does customerA receive?



I would like to sell event tickets - and waiting until the customer checks out to adjust and/or control the inventory will not work for my needs. When I have 500 customer on the site at 11AM to buy 300 tickets, I need a way for them to reserve their cart selections.
If Nop does not handle this, it would be great to hear from anyone who knows of any workarounds.

Thank you
11 years ago
Wow - I am surprised, and disappointed, that no one can answer this question.
11 years ago
Inventory isn't adjusted until the order is placed.  To make your change you would just need to move this line from OrderProcessingService -> PlaceOrder to the AddToCart functions:

_productService.AdjustInventory(sc.ProductVariant, true, sc.Quantity, sc.AttributesXml);


And whenever you decided to expire the cart, run it again but change true to false to put the stock back in to inventory.
11 years ago
kurtzilla wrote:
I am trying to determine when inventory is accounted for in the shopping process. Many ecommerce systems don't adjust inventory until the order has been processed. I need a solution where if the customer puts an item in their cart, they are guaranteed that item for at least a few minutes until they check out.

How does NopCommerce handle this?


[Sample scenario]
I have a ProductOne with an inventory of 1.

If customerA puts this in their cart, can customerB also put those items in their cart prior to customerA checking out?

Supposing that were true, and if customerB checks out first - what message does customerA receive?



I would like to sell event tickets - and waiting until the customer checks out to adjust and/or control the inventory will not work for my needs. When I have 500 customer on the site at 11AM to buy 300 tickets, I need a way for them to reserve their cart selections.
If Nop does not handle this, it would be great to hear from anyone who knows of any workarounds.

Thank you

Stock is adjusted when order has been processed. What you want is not available out of the box. It will require some customization to adjust inventory when items are added to cart and then run a scheduled task that will cancel orders which have not been placed within a time limit. Check this and this
7 years ago
AndyMcKenna wrote:
Inventory isn't adjusted until the order is placed.  To make your change you would just need to move this line from OrderProcessingService -> PlaceOrder to the AddToCart functions:

_productService.AdjustInventory(sc.ProductVariant, true, sc.Quantity, sc.AttributesXml);


And whenever you decided to expire the cart, run it again but change true to false to put the stock back in to inventory.


I have an urgent need for this but I can't seem to get it working in version 3.4 using this method. Any help/suggestions would be greatly appreciated!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.