Page 1 of 1

[SOLVED] - Customer orders duplicating on checkout

Posted: Sun Apr 12, 2020 11:55 am
by Zidane
Thanks for all who add to this helpful forum.
I have been using OC for a number of years and have found solutions in the forum to all previous issues, except this one.

After upgrading to OC 3.0.2.0, every now and then, like 2-4% of the time, a customer's order will double without them realizing. The quantity doesn't double, their whole order will be duplicated.

I am collecting these orders to see if I can find the pattern but no luck so far.

I have not been able to find anyone on here experiencing the same issue.

I am using a few plugins and as yet I haven't turned any of them off.

At first I thought it was a cookie thing i.e. customers returning to the shop/website and ordering again, not realizing their previous order was stored in a cookie.
I don't think it is this, it seems to be happening on the checkout page, although I cannot recreate it.

Nothing of interest in the error logs.

If someone can point me in the right direction that would be greatly appreciated.

Thanks
Tom

Re: Customer orders duplicating on checkout

Posted: Sun Apr 12, 2020 3:37 pm
by letxobnav

Re: Customer orders duplicating on checkout

Posted: Tue Apr 14, 2020 5:05 am
by Zidane
Thanks letxobnav,
I was able to reproduce the issue, after registering at checkout. I might add that the posts you linked to mention large orders (15+ items). Although for me the issue happens even with one item in the cart.

I will try what is mentioned in the above link, however there appears to be 3 fixes, 1: simple, one line of code in cart.php, 2: two new functions in register.php and login.php, and 3: a third that doesn't have much of an explanation.
Not being that experienced with code I am tempted for the simple solution. Could you perhaps tell me which to go for/try?
Thanks
Tom

Re: Customer orders duplicating on checkout

Posted: Tue Apr 14, 2020 5:58 am
by straightlight
1: simple, one line of code in cart.php, 2: two new functions in register.php and login.php, and 3: a third that doesn't have much of an explanation.
Where are those three solutions you are referring about?

Re: Customer orders duplicating on checkout

Posted: Tue Apr 14, 2020 6:16 am
by Zidane
straightlight wrote:
Tue Apr 14, 2020 5:58 am
1: simple, one line of code in cart.php, 2: two new functions in register.php and login.php, and 3: a third that doesn't have much of an explanation.
Where are those three solutions you are referring about?
Hey Straightlight,

They are in this post:
viewtopic.php?t=211273

Thanks
Tom

Re: Customer orders duplicating on checkout

Posted: Tue Apr 14, 2020 6:30 am
by straightlight
What that post indicates is whenever the customer ID is 0, it has been tweaked about cart duplication with a user-defined method. However, it may not avoid cart duplication whenever the customer ID is above 0.

Re: Customer orders duplicating on checkout

Posted: Tue Apr 14, 2020 9:24 am
by Zidane
[SOLVED]
I can confirm the link to the previous post, following edits to a number of cart, checkout and register files, has seemed to have solved the problem.
Thanks to all involved.
Tom

Re: [SOLVED] - Customer orders duplicating on checkout

Posted: Fri May 10, 2024 5:10 pm
by fredJ
I tried these fixes but still have this problem from time to time.
???
Main problem is that when it happens the item stock gets reduced twice. If it's a large order, I annull it so it only gets reduced once. If it's a smaller order I can manually update the stock for the item or items.

At least there should be some function to ensure that stock value doesn't go below 0.
It's weird how the order gets put in twice, since it only has one order number. How can the system allow the order to be placed twice? Shouldn't there be some function that makes it impossible?

Re: [SOLVED] - Customer orders duplicating on checkout

Posted: Sat May 11, 2024 12:02 am
by ADD Creative
fredJ wrote:
Fri May 10, 2024 5:10 pm
I tried these fixes but still have this problem from time to time.
???
Main problem is that when it happens the item stock gets reduced twice. If it's a large order, I annull it so it only gets reduced once. If it's a smaller order I can manually update the stock for the item or items.

At least there should be some function to ensure that stock value doesn't go below 0.
It's weird how the order gets put in twice, since it only has one order number. How can the system allow the order to be placed twice? Shouldn't there be some function that makes it impossible?
Are you seeing two seperate orders or just a single order with the products doubled?

Re: [SOLVED] - Customer orders duplicating on checkout

Posted: Mon May 13, 2024 7:21 pm
by fredJ
ADD Creative wrote:
Sat May 11, 2024 12:02 am
fredJ wrote:
Fri May 10, 2024 5:10 pm
I tried these fixes but still have this problem from time to time.
???
Main problem is that when it happens the item stock gets reduced twice. If it's a large order, I annull it so it only gets reduced once. If it's a smaller order I can manually update the stock for the item or items.

At least there should be some function to ensure that stock value doesn't go below 0.
It's weird how the order gets put in twice, since it only has one order number. How can the system allow the order to be placed twice? Shouldn't there be some function that makes it impossible?
Are you seeing two seperate orders or just a single order with the products doubled?
Thanks for your response.
I get one order with one order number, but it registers twice somehow.

I get two order emails, and when I check order history, it has two lines in it both saying "waiting".
So it's like it registers the purchase two times, but only deducts money one time.

It only seems to happen when customers check out through card checkout. But still it doesn't happen every time they chose card checkout, only maybe 5% of the times. However, it is always the same customers who "double order".

Here some user agents they use:
* Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
* Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Mobile Safari/537.36
* Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.15
* Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0

So, what can I do? Any suggestion?

Re: [SOLVED] - Customer orders duplicating on checkout

Posted: Mon May 13, 2024 11:27 pm
by ADD Creative
fredJ wrote:
Mon May 13, 2024 7:21 pm
Thanks for your response.
I get one order with one order number, but it registers twice somehow.

I get two order emails, and when I check order history, it has two lines in it both saying "waiting".
So it's like it registers the purchase two times, but only deducts money one time.

It only seems to happen when customers check out through card checkout. But still it doesn't happen every time they chose card checkout, only maybe 5% of the times. However, it is always the same customers who "double order".

Here some user agents they use:
* Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
* Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Mobile Safari/537.36
* Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.15
* Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0

So, what can I do? Any suggestion?
It's could be an issue with your card payment extension. It looks like somehow the confirmation of payment is being received twice. Have you check both your OpenCart and PHP error logs? Does you payment extension have a debug log? Have you contacted the developer?

Re: [SOLVED] - Customer orders duplicating on checkout

Posted: Thu May 16, 2024 9:56 pm
by fredJ
Okay thanks!
I will check into the error log.