Duplicate "Order #xxx has been processed" emails

I’m running some test orders on my site to iron out any problems before I go live.



For some reason my “Order # XXX Has Been Processed” emails are being sent twice.



I can’t figure out why this would be. The emails are sent within 1 or 2 seconds of eachother.



Addiotnally, I just noticed that the order completed emails are only sent if I set them to completed while viewing the full order detail page, not just by changing the status to completed while viewing the page with all orders. I DO have the box checked in the settings to notify customer of a “completed” status.

Another bit of info.



I changed my default order status value within my payment file to be “C” instead of “P” and found that it still went double duty on the emails. So, whether it was even a possibility or not, it rules out an error on the part of “Processed” emails in general.



Any thoughts?

Check the settings for the status changes. I.e. is Send Email checked for status other than P? If it’s set for O then one will probably be sent when the order is created and another when it is processed. There seem to be some bugs in the email on status area.

I double and triple checked. The only status that has the checkbox for notify customer is “Processed.”



If it’s a bug, are there any workarounds?



Is anyone using 2.04 NOT having this issue?

Have you created a separate account to do test orders other than the admin account?



If not then this is because your the admin, try creating a test customer account on your site and make a test order, you should only receive the one email.

Don’t know, can’t go to 2.0.4 because they changed the way they do page layout and it breaks my (and my customer’s) sites.

Unfortunately this is not with my admin account. I have tested this with 2 email addresses that otherwise have no association with the website.


[quote name=‘wartornskull’]Have you created a separate account to do test orders other than the admin account?



If not then this is because your the admin, try creating a test customer account on your site and make a test order, you should only receive the one email.[/QUOTE]

hmmm, I’ve just ran some tests on my test site and don’t seem to have any problems with this duplicate email issue.



What email function are you using? (I.e. are you using sendmail, smtp or php mail)

I’m using the php mail function - I believe it was the default. I haven’t looked into the different methods yet.

hmmm same here.



It could be down to something like your server settings.



Other than that I don’t know as like I said it works fine on my side I’ve tested it on my localhost, dedicated server and a shared server.



Sorry.

Any suggestions for checking the server settings?



I am somewhat blind when it comes to the backend workings of the server.

CS-Cart support just said they were able to replicate the problem. They said its a bug and they’d get back to me.



I wonder if it is authorize.net specific since not everyone has this issue.

[quote name=‘baniels’] I wonder if it is authorize.net specific since not everyone has this issue.[/QUOTE]





I am a (2.0.4 user) I dont think it is authorize.net alone, I use only paypal and I too get double emails sent to clients and I get double emails sent to me.



Hope a fix is found soon.



Really frustrated!:confused:

CS-Cart support fixed this for me. I asked them for the solution to share it here. This is what they gave me.



In the “fn.cart.php” file located in the “core” directory.



Replace this part of the code

function fn_order_notification(&$order_info, $edp_data = array(), $force_notification = null)
{




with this one:

function fn_order_notification(&$order_info, $edp_data = array(), $force_notification = null)
{
static $notified;

if ($notified) {
return true;
}






and this part of the code:
if ($notify_user == true) {






with this one:


if ($notify_user == true) {
$notified = true;

Thanks Baniels,



I’ve been looking into this personally myself so your post is extremely helpful

Replaced the code but still getting double emails when paypal payments are made.

Did the fix work for others.

lmk

thanks

I’m using v2.0.6 and I see the new code in the fn.cart.php file. I just got my first order today and I received three duplicate order processed emails. I have notify off on processed orders, I hope this means the customer didn’t get duplicate emails.

im getting 3 emails sent to my suppliers for each order

Helpdesk provided a fix for v2.1.4


  1. Open the fn.common.php file located in the core directory of your CS-Cart installation.
  2. Replace this part of the code:

$force_notification = array();

if ($disable_notification) {

$force_notification = array('C' => false, 'A' => false);

} else {




with this one:

$force_notification = array();

if ($disable_notification) {

$force_notification = array('C' => false, 'A' => false, 'S' => false);

} else {