Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2008
    Posts
    4
    Plugin Contributions
    0

    Default Same product sold twice

    We will soon introduce some products to our store that most likely will be sold within minutes after they have been put for sale. In order to check how Zen-Cart behaved when more people try to buy the same product, we simulated a situation where two customers put the same product in the shopping-cart and completed the check-out more or less simultaneous. The result was that both orders went through and the stock went to -1. The stock settings are set to not allow checkout when products are sold out.

    Does anyone have a suggestion to what we can do to avoid selling the same product many times?

    Now we tried this with the bankdeposit module. Anyone having an idea if the same will happen using paypal (as the only choice)?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Same product sold twice

    Stock is reduced upon completion of a successful order - changing this is much code to alter
    Zen-Venom Get Bitten

  3. #3
    Join Date
    May 2009
    Posts
    1
    Plugin Contributions
    0

    Idea or Suggestion Re: Same product sold twice

    Since we've encountered the same problem I thought I would add my tuppence. (More like £20 note, but hey)
    Yes, it does happen with Paypal and by Cheque. As far as I can see it will happen with any payment module if two customers get past the "Confirm Order" page before one of them is returned from the payment module.

    Kobra (presumably an aficionado ) is dead right the stock decrement is done after the payment module. Checks are done for stock at the latest on the loading of the Confirm order page. It is also very heavily entwined by the looks of it into the final processes. The names baffled me for some time but order->create_add_products (In orders.php class code) seems to be responsible for re adjusting stock levels. It appears to be called from within checkout_process.php, which I thought was just before the payment module. Of course I could be completely wrong, and have missed the proper final program. But I'll shove that up for anyone desperate in the future.

    The design is based on a "When you've paid me, I record the stock decrease" concept. Which, in high stock levels doesn't matter too much if you over sell 1, as you will likely be able to restock and apologies and inform the customer (If you notice). However as many unique item sellers are finding (Crafts, antiques, second hand books, etc), this is not an appropriate design weakness for them. Especially those whom do bulk updates and have a Hawking customer base. Its not about Zen cart being wrong, its about a different shop business model.

    Decrementing the stock when It is put in the cart is also fairly incorrect, as often carts are abandoned, Disconnected, or intentionally left full and floating. Meaning that customer is withholding stock from other customers by hiding in the toilet with a full shopping basket. It is closer to the real life metaphor though. And it will seem an appealing solution to those with this problem. Code could be written to compensate, but it isnt in Zen as its not designed like that.

    A middle ground would be to reserve any items in a basket until there abandoned etc, perhaps putting them in a reserved stock figure. Then waiting until the payment is processed to properly decrement the stock. This however is a completely different model and not easy for Zen to bend itself to.

    Still, long and short of it is Zen does not work like this. If you are reading this in search of a solution, as far as we have found your options are;
    1. Mildly modify Zen to add another stock check in the Checkout_process to further decrease the window where two people can purchase the last stock item.
    2. Try and hack the stock change as it stands to be placed in the beginning of the checkout process (checkout_shipping). An advisable alternative to doing the stock decrement on entry into the basket. This will be difficult and potential dangerous to other safety checks in Zen-Cart.
    3. Put up with it and prepare your eager customers to get refunds.
    4. Wait until Zen-Cart 2.0 which may address this issue.
    5. Find another product

 

 

Similar Threads

  1. Replies: 6
    Last Post: 2 Dec 2011, 03:06 PM
  2. Replies: 6
    Last Post: 26 Aug 2009, 06:49 AM
  3. New Products Sidebox: Same Product Listed Twice
    By MeltDown in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 20 Apr 2009, 09:36 PM
  4. product appear twice in the same category
    By mipavluk in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 2 Apr 2009, 02:12 AM
  5. adding same product twice to shopping cart ...
    By grossd in forum General Questions
    Replies: 4
    Last Post: 21 Jul 2006, 03:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR