Forums / General Questions / Multiple identical orders received simultaneously, leaving negative stock

Multiple identical orders received simultaneously, leaving negative stock

Views: 670

Results 1 to 3 of 3
26 Dec 2012, 8:25 PM
#1
omnicognate avatar

omnicognate

New Zenner

Join Date:
Feb 2011
Posts:
21
Plugin Contributions:
0

Multiple identical orders received simultaneously, leaving negative stock

Using ZC 1.3.9h.

This is really odd. We have a product which had only one unit left in stock (products_quantity = 1). We just received 3 separate orders for this item from the same customer, one unit in each order. The orders are all listed in state "Processing" in the admin interface, and they are listed as all having been received in the space of 3 seconds: 17:17:36, 17:17:37, 17:17:38.

The stock level now reads -2, and "low stock" warning emails were sent to us with stock counts 0, -1 and -2. The item should have been listed as out of stock on the website when the stock level reached zero, and indeed is now showing as sold out.

We have, so far at least, only received a single actual payment, which came via paypal, which is enough to cover only one unit of the stock.

My strong suspicion here is that the customer actually only placed a single order, and that something has gone wrong with the paypal checkout process or within zen cart itself, that has resulted in the order being recorded 3 times.

Does anybody have any ideas? The site has been running for 3 years or so without seeing any such behaviour.

26 Dec 2012, 10:31 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Multiple identical orders received simultaneously, leaving negative stock

There are many PayPal modules. Which one did this order come through?

Sounds like the customer maybe clicked "submit" several times, or maybe if you're using the old/unrecommended IPN module then maybe it was hicupping perhaps from PayPal sending multiple notifications to your store. Many unknowns.

Chances are your stock "problem" is only a reflection of the same order being submitted multiple times and decrementing inventory each time, because once it's past a certain stage it doesn't check for stock anymore because it's probably at the point where there'd normally be no reason to check inventory because the order is being completed. A stutter of sorts caused by some conflict or malfunction.

And maybe if it was caused by a bug then that bug might have been fixed in a newer version of Zen Cart. Hard to know.

http://www.zen-cart.com/showthread.php?61199-Debug-Logging-PayPal

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

27 Dec 2012, 1:09 AM
#3
omnicognate avatar

omnicognate

New Zenner

Join Date:
Feb 2011
Posts:
21
Plugin Contributions:
0

Re: Multiple identical orders received simultaneously, leaving negative stock

Sounds like there are many possible causes, including some likely ones that wouldn't indicate a bug or misconfiguration. For now, we've just deleted the duplicate orders and will keep an eye out to see if it happens again. As mentioned before this is the first time this has happened in years of operation. In any case, we are looking to upgrade to 1.5.1 and switch to SagePay soon, which may render any further investigation of this issue redundant.

FWIW, the payment module on the orders was listed as paypalwpp (Express Checkout).