Zen Cart Logo
Forums / Managing Customers and Orders / Duplicate Orders

Duplicate Orders

Views: 11,117

Results 21 to 26 of 26
26 Jan 2016, 11:15 AM
#21
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Duplicate Orders

carlwhat:

  • still mourning the loss of David Bowie.

:-(

carlwhat:

seriously, as i stated in the link that i provided,.

Shoot. I was so happy I found the cause that I didn't even follow the link. (Something I shall rectify shorlty)

carlwhat:

built-in ZC logging function would have saved us both many hours of time and frustration as it would have pointed us both in the right direction as to the cause of the problem..

I don't know if it would have helped or not in this case - because one of the symptoms (or lack of) was the fact that the emails were actually being sent (and received by the recipient's server) before the 'checkout success' page was loaded.

It as though the process was going something like this

- order gets created
- emails get sent
- mail process hangs around for 90 seconds doing nothing
- cart gets cleared
- Checkout success page displayed

After I'd discovered that it was the mail process holding things up I upped the logging level up a few notches on the mail server and observed what was going on - In a word 'nothing' was going on during that 90 seconds.

The entry prior to the delay is/was "Message accepted for Delivery"
The next entry (90 seconds later) is/was the "stat=Sent (OK)" message.

carlwhat:

glad you were able to identify the problem. indeed, identifying the problem is much more difficult and worthy of celebration that implementing a solution.

I am now celebrating having found the solution. It was a TLS certificate issue - or more specifically, the server didn't have (or had somehow lost) its sendmail.pem file (there were warnings about this in the log files when the server got started, but as mails were being sent received with no apparent issue I hadn't taken much notice of it until now).

Anyway, I recreated this file, restarted the mail server and all is good.

Cheers
RodG

31 Jul 2016, 4:43 PM
#22
d0ugparker avatar

d0ugparker

Zen Follower

Join Date:
May 2008
Location:
Near the water, somewhere...
Posts:
129
Plugin Contributions:
0

Re: Duplicate Orders

RodG:

I am now celebrating having found the solution. It was
a TLS certificate issue - or more specifically, the server
didn't have (or had somehow lost) its sendmail.pem file
(there were warnings about this in the log files when the
server got started, but as emails were being sent received
with no apparent issue I hadn't taken much notice of it
until now).

Anyway, I recreated this file, restarted the mail server
and all is good.

RodG

So, you're no longer getting duplicates or triplicates? Geez,
I want that.

I read through the thread, and if I'm reading things right, by
sending a private key to my web host and having them install
or confirm the accuracy of that .pem file's contents on their
mail server, I should be able to eliminate my occasional,
random, double orders. (No, I've never seen a 3-cate)

Care to comment? :-)

...and this thread is non-sticky because, er... why? ;-) Okay,
maybe not sticky, but how about its becoming an FAQ item?

Regards,

31 Jul 2016, 6:23 PM
#23
drbyte avatar

drbyte

Sensei

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

Re: Duplicate Orders

RodG:

In short - Regardless of the chackout method/options - as soon as that 'confirm' button is hit, the order is processed, but the 'checkout success' page doesn't appear for thew 1-3 minutes.

Note: This example shows ~90 seconds elapsed between the 'checkout_process' and the 'checkout_success'.

I'm confident that this isn't technically a ZenCart issue (same code both sites), and if it were a server overload issue (my initial thoughts) then I'd have expected the problem to worsen on the lower powered VPS

lhungil:

A delay with communication to the email server could make sense (and would be triggered in checkout, new account creation, and status change w/ notification). Can probably test in the Zen Cart admin to see if sending an email shows a similiar delay.

I've read reports of PHP mail() sometimes being slow if DNS resolution takes an extended time. And SMTP could also be delayed by QOS / rate limiting.

RodG:

After I'd discovered that it was the mail process holding things up I upped the logging level up a few notches on the mail server and observed what was going on - In a word 'nothing' was going on during that 90 seconds.

The entry prior to the delay is/was "Message accepted for Delivery"
The next entry (90 seconds later) is/was the "stat=Sent (OK)" message.

I am now celebrating having found the solution. It was a TLS certificate issue - or more specifically, the server didn't have (or had somehow lost) its sendmail.pem file (there were warnings about this in the log files when the server got started, but as mails were being sent received with no apparent issue I hadn't taken much notice of it until now).

Anyway, I recreated this file, restarted the mail server and all is good.

Cheers
RodG
Thanks Rod for the detailed analysis and summary of the problem, including the fix.

Important clarification: The "duplicate orders" were a result of the customer clicking multiple times to submit their payment because it appeared to them that it hadn't "taken", because of timeout delays while sending the confirmation email.

In Rod's case it was a server misconfiguration with (expired) TLS certificates within Sendmail.

Another alternate way around it:
Change the Email Transport Method in ZC admin->Configuration->Email Options to SMTPAUTH and point it to another server to do the email delivery (ie: one could sign up for a free account at MailGun and once fully configured simply provide the SMTP credentials to your ZC store and then Mailgun will handle all the delivery, instead of relying on your hosting company to keep their servers current)

31 Jul 2016, 8:17 PM
#24
d0ugparker avatar

d0ugparker

Zen Follower

Join Date:
May 2008
Location:
Near the water, somewhere...
Posts:
129
Plugin Contributions:
0

Re: Duplicate Orders

DrByte:

Thanks Rod for the detailed analysis and summary of the problem, including the fix.

Important clarification: The "duplicate orders" were a result of the customer clicking multiple times to submit their payment because it appeared to them that it hadn't "taken", because of timeout delays while sending the confirmation email.

Could a smidgeon of php code or javascript change the

SUBMIT ORDER

button to a

WAIT

button, removing the href the instant the mouseup occurs?

31 Jul 2016, 9:03 PM
#25
drbyte avatar

drbyte

Sensei

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

Re: Duplicate Orders

d0ugparker:

Could a smidgeon of php code or javascript change the

SUBMIT ORDER

button to a

WAIT

button, removing the href the instant the mouseup occurs?
The default code in Zen Cart's default template already changes the mouse-pointer to a spinner, and disables-and-grays-out the submit button. I believe it's done that since v1.5.0.
But some 3rd party templates change the way that works. There are a bunch of forum discussions about "disabling the submit button on checkout confirmation", where various alternate code snippets have been shared.

1 Aug 2016, 9:35 AM
#26
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Duplicate Orders

d0ugparker:

So, you're no longer getting duplicates or triplicates?

Correct. Not a single duplicate order since adding the .pem

d0ugparker:

I read through the thread, and if I'm reading things right, by
sending a private key to my web host and having them install
or confirm the accuracy of that .pem file's contents on their
mail server, I should be able to eliminate my occasional,
random, double orders. (No, I've never seen a 3-cate)

Care to comment? :-)

Yes. The site I had the issue with was a VPS. so ultimately it was a problem that I needed to fix myself. Your webhost should already have a valid cert installed and a correctly functioning mail server,so my findings, problem and fix probably won't apply to you.

DrByte:

Important clarification: The "duplicate orders" were a result of the customer clicking multiple times to submit their payment because it appeared to them that it hadn't "taken", because of timeout delays while sending the confirmation email.

In my scenario that doesn't appear to have been the case (from memory). I realise that this is the logical reasoning, but after having replicated the issue I'm pretty confident that the duplicate orders weren't a result of multiple clicks.

d0ugparker:

...and this thread is non-sticky because, er... why? ;-) Okay,
maybe not sticky, but how about its becoming an FAQ item?

It probably not really a FAQ question -- or at the very least, the cause and solution (in my case) would be way down the list of possible causes.

In hindsight, I probably would have narrowed the cause down a lot sooner if I had tried using a different mailserver (as per DrByte's recent suggestion), but I really had no reason to suspect that it was a mail server issue until I'd actually discovered the cause.

It could be a suggestion for your to try though, if nothing else it will help eliminate whether your dupe problem being is mail related, or has some other cause.

Cheers
RodG