Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Richard Ockerby 35 posts 210 karma points MVP 4x c-trib
    Oct 27, 2022 @ 08:37
    Richard Ockerby
    0

    Vendr: Reserve an item

    Hi Umbraco Community!

    I have a site running with Vendr and it's working lovely (thanks Outfield Digital) and we're looking to implement a basket reservation system. By this I mean that having an item in the basket adjusts the stock level for the product.

    E.g.

    • Product A has 1 stock left.
    • User A adds Product A to the basket
    • Product A reduces down to 0 stock
    • User B sees 'Out of stock' on the product

    There are other questions about releasing stock if the order is sitting for too long etc. but I'm curious about how much of this functionality (if any) already exists in Vendr, and if not, how to get started.

    Thank you, Richard

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Oct 27, 2022 @ 09:13
    Matt Brailsford
    100

    Hey Richard,

    The only "Stock" logic we have is to reduce stock when an item is purchased, so we don't reserve stock whilst an item is in the basket.

    I don't suppose there is anything to stop you reducing the stock as items are added to the cart, but you'll have to introduce event handlers to do it. We do have a Product Service on which you can ask to reduce / increase stock so you could inject this and call those methods. I guess you'd likely also need to disable the defauilt behaviour of reducing stock on order finalization as you don't want to reduce the stock twice.

    I think the issue is going to be keeping things in sync, and also what to do with carts that become abandoned as Vendr doesn't clear these out an they can be pretty long lived so you may need some routine to clear unprocessed carts after a certain period of inactivity.

  • Richard Ockerby 35 posts 210 karma points MVP 4x c-trib
    Oct 27, 2022 @ 09:37
    Richard Ockerby
    0

    I thought that would be the answer - this sounds like a big job, with lots of caveats and pitfalls to make sure it's done right.

    Thanks for the response Matt, appreciated.

Please Sign in or register to post replies

Write your reply to:

Draft