Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2012
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Inventory Question

    My question is more related to process than actually coding.

    When dealing with an inventory, what is the best approach to managing the inventory so that you don't under sell nor over sell.

    When is the best time to decrease the quantity of the inventory, when the user puts the product in their shopping cart or after a successful purchase?

    If the inventory is decreased after the product is put in the shopping cart, then if the inventory is =0, then no one else can put the product in their shopping cart, and the product would show as sold out. But if the user never purchases their shopping cart, then the inventory would be incorrect, because it would show one less product that was actually sold.

    Now if you only decrease the inventory after a successful purchase, then you could have a user put the product in their shopping cart, and then when going to pay for the product, then find that the inventory is now 0.

    So is it best practice to have two inventorys, pre-purchase and post-purchase?

    The product I'm developing could have multiple people attempt to buy a limited quantity of product in a short time, so I don't want to undersell nor oversell.

    Hopefully I articuated this question clearly!

  • #2
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,394
    Thanks
    67
    Thanked 102 Times in 101 Posts
    Without a doubt, use post-inventory update. The reason is because thousands of people like myself add items to a shopping cart to see how much shipping will cost. Other start to buy and decide not to.

    Also your item still exists until after checkout, you didn't actually sell it until you have received payment for it.

    If you have 3 quantity and someone has 3 quantity in their shopping. Then another person adds 1 - 3 to theirs, and the one with 3 quantity checks out first. Make a message to the second person that says like "Sorry but we just ran out of that item, check back soon for more".
    Been a sign maker for 7 years. My business:
    American Made Signs

  • #3
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    add 'hold-timeout' to your process...

    so, when i add a product into my cart it adds a hold timeout value so other browsers would see no product available if i'd added the last one to my cart...

    then if i don't checkout in a certain timeout time it then becomes available again to visitors..

    it should prob depend on your type of shoppers too, if they regularly just add to cart but don't checkout then myfayt's solution is probably best but if your visitors usually go to checkout when adding to cart a timeout solution would be best

    hope this makes sense...

  • #4
    Regular Coder
    Join Date
    Jan 2012
    Posts
    134
    Thanks
    0
    Thanked 32 Times in 32 Posts
    I agree with jm. You should at least consider the possibility of a "hold" on items. If I go to purchase something that says there are 4 in stock, then get to the last step of the check out process and suddenly there are only 2, I'm going to be pretty frustrated.

    I don't have any research to back this up, but it would seem to me that the best time to attach the hold is as soon as the checkout process begins for a certain item. That way you still have items in stock as people are browsing, but the user is notified BEFORE they begin a checkout process whether or not their items are still available.

    Obviously you should then have some timeout to "replenish" your stock if someone never completes the checkout process.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •