Page 1 of 1

Customers checking out around same time puts stock on -1?

Posted: Thu Oct 25, 2012 3:44 pm
by harryo40
Running OC1.5.1.3

Hi,
This is not the first time its happened but 2 customers have checked out with the same product in there cart & both paid with paypal, but there was only 1 of these products available which leaves the stock quantity on -1.

The time the orders were added in the database, there is 26 seconds between them.

On a previous ocasssion, the same thing happened but one paid with paypal & the other with card, but there was just over 2 minutes difference between the orders being added to the database.

Is there some way of avoiding this or can something be changed in the coding in order to prevent this from happening? Because having to contact one of the customers & explain to them that the item is no longer available, is not ideal or the best way to run an ecommerce store?
regards

Re: Customers checking out around same time puts stock on -1

Posted: Thu Oct 25, 2012 10:19 pm
by pedro1993
When a user is at the checkout page the level is verified (for the last time) when they reach the confirm order section. Once they press order they are obviously directed to PayPal/the other payment method.

The only way I can think this happened is the users both got to PayPal at the same time. Once they are on PayPal's website there is no way of actually checking the stock before payment because they are temporily on another site. I can't be sure without trying it myself.

When they are returned to your website the payment has already been taken and that is when the order is placed on your database, despite your stock levels. At that point you can't check the stock level and deny the order because the customer has technically paid.

There are work arounds which I can think of:

1. For each product, add 2 less to your quantity. For example if you had 10 pencils in stock, add 8 to OpenCart that way you have 2 on standby if anything goes wrong.

2. I am not sure if this has been done on OpenCart. But some websites (like ticket websites) change the stock whilst the user at the checkout. For example, when if I try buy 5 pencils, the stock will be changed then. This gives OpenCart enough time to check if the item is actually in stock before the user reaches the checkout. This also means any other users trying to order the same might get an error saying that the product is now unavailable.

Peter :)

Re: Customers checking out around same time puts stock on -1

Posted: Fri Oct 26, 2012 12:31 am
by Avvici
I agree, there needs to me a "temporary" hold on an item if in that particular session there is a customer wanting certain items. However, the hold cannot last too long and needs to have conditions because someone could keep their browser window open for 5 hours on the checkout page which would lose you sales due to a lack of stock "which in reality is actually there." It's an interesting point however.

Re: Customers checking out around same time puts stock on -1

Posted: Fri Oct 26, 2012 12:52 am
by harryo40
pedro1993 wrote:2. I am not sure if this has been done on OpenCart. But some websites (like ticket websites) change the stock whilst the user at the checkout. For example, when if I try buy 5 pencils, the stock will be changed then. This gives OpenCart enough time to check if the item is actually in stock before the user reaches the checkout. This also means any other users trying to order the same might get an error saying that the product is now unavailable.
Peter :)
I agree with this part but your first point would not work for us as most products are one offs meaning we do not have quantities of them.

Having the cart deduct the item from the total stock as soon as its added to cart sounds like a good idea & would solve the problem but like you both say, it needs to be only for a certain time, such as 1 hour.
If the customer has not checked out in one hour or they logout of there account or they simply leave there computer for hours, the item would then show back on the site for others to purchase, but implementing this would mean changing quite a bit I would have thought, but it would certainly solve the problem we have had on more than one occasion.
Other people may not experience this problem because they probably have quantities per product but when 98% of your products have a quantity of 1, then its starting to create problems for us.

Re: Customers checking out around same time puts stock on -1

Posted: Fri Oct 26, 2012 1:24 am
by Avvici
I think you would benefit from a little custom work on your store to make sure this doesn't happen. Lots of good developers on the forum that would be willing to help you out. That is, if there isn't already an extension for it. (probably not)

Re: Customers checking out around same time puts stock on -1

Posted: Fri Oct 26, 2012 1:50 am
by harryo40
I doesn't happen often but I do know it has happened on at least 3 occasions & the 3rd time was yesterday. I know there was only 26 seconds between when they were added into the database but the last time, which was around 4 weeks ago, there was over 2 minutes between them & one paid with paypal & the other using a credit / debit card.
As for tons of shoppers, no matter how many you have, you could always do with more lol

Re: Customers checking out around same time puts stock on -1

Posted: Fri Oct 26, 2012 2:43 am
by pedro1993
harryo40 wrote:I doesn't happen often but I do know it has happened on at least 3 occasions & the 3rd time was yesterday. I know there was only 26 seconds between when they were added into the database but the last time, which was around 4 weeks ago, there was over 2 minutes between them & one paid with paypal & the other using a credit / debit card.
As for tons of shoppers, no matter how many you have, you could always do with more lol
I think it is ticket master in the UK who have a system like this. It is really clear and helpfull for the user because it has a five minute countdown showing. The countdown is reset to 5 minutes each time the user completes a stage at the checkout, so the only way it reaches 0 is if the user leaves or does nothing on the website. Of course the timer is not a must have. I'd imagine some website operate link this without the user knowing

This is something I can do, or as avvici said, pop on to the commercial forums :)

Re: Customers checking out around same time puts stock on -1

Posted: Fri Oct 26, 2012 4:18 am
by harryo40
pedro1993 wrote:The countdown is reset to 5 minutes each time the user completes a stage at the checkout, so the only way it reaches 0 is if the user leaves or does nothing on the website. Of course the timer is not a must have. I'd imagine some website operate link this without the user knowing

This is something I can do, or as avvici said, pop on to the commercial forums :)
Sound like it will stop people being able to check out with the same products.
I am away for 2 weeks very soon but is it ok for me to PM you when I return & we can discuss this more?
thanks for the help by the way ;)

Re: Customers checking out around same time puts stock on -1

Posted: Fri Oct 26, 2012 6:14 am
by pedro1993
Lucky for some, I wish I was away for a few weeks! :P Yeah sure, not a problem :)