Decrement available quantity as soon as an item is added to shopping cart

Created on 4 September 2020, about 4 years ago
Updated 7 June 2024, 6 months ago

I have a site where all of the items for sale are one-off. My problem is that although the module does a good job of not allowing me to add a second item of one type to my shopping cart, if I open a second browser, I can add that item to my cart. The implication here is that 2 people can order an item when only one item is available.

Have I missed something? Is there a way to decrement the available quantity to 0 as soon as the item is placed in the cart?

πŸ’¬ Support request
Status

Needs review

Version

1.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States d2d

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡Έ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 enforcement

    My 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.

Production build 0.71.5 2024