- πΊπΈUnited States DamienMcKenna NH, USA
Should it instead double-check the inventory as part of the checkout process? On one site I'm involved in they regularly have people add items to their cart and leave them there for several days; this change could potentially stop would prevent others from completing their transaction.
While I do appreciate the idea of a customer walking around in a store with an item in their cart they haven't bought yet, in this analogy the customer wouldn't continue walking around the store for two weeks deciding whether they wanted to buy it.
Many sites that have tight inventory controls will have a timer that requires a visitor to complete the checkout within a certain amount of time, otherwise the item is made available for others. This is common with event ticket sales, e.g. concerts, etc.
- πΊπΈUnited States DamienMcKenna NH, USA
I opened a separate issue for my idea from #11: β¨ Double-check inventory when checkout started Active
- π΅πͺPeru krystalcode
Configuration option to determine whether stock should be reserved upon order placement or when adding products to cart.
This is optional. If that is not the requirement for your site, do not configure it to reserve the item when it is added to the cart.
- π³π±Netherlands gidarai
Rerolled the patch from #10 and added numerous fixes.
- The 'stock reservation upon adding to cart' feature is now fully optional
- Patch now works with the latest version
- Improved stock form functionality
- Added support for stock enforcementMy colleague (@arantxio.gottmers) and i have been working on this as we need it for our site and thought it would be beneficial to share it here as well.
- π³π±Netherlands arantxio Dordrecht
I've noticed that it missed a import, so here is the adjusted patch.
- Status changed to RTBC
about 2 months ago 8:57am 18 February 2025 - π³π±Netherlands gidarai
This patch also works for version 3.x, so i'll up the target version. Can this be committed if there's nothing holding it back?
We have been using this patch for our production site for about a few months now without any issues.
- π¬π§United Kingdom guy_schneerson
Amazing work on this.
I am happy to add this feature, although it is not a complete solution as stock does not support the expression of the cart and does not have a dependency on a module that can.
But as it's optional, I think we can add it (I may reword it a bit but that's not a blocking issue).
I will, however, only commit new features to the 3.x branch.
As this is a significant update, I will need to review it properly before committing. So far all looks good and works as expected.