Post by j150tfp » Mon Feb 15, 2021 8:18 am

Hi,

I am using opencart 2.3.0.2
Hoping I could get some help:

Customers are receiving 2 x order confirmation emails. (Same order number) the actual orders are not duplicated on admin.

Admin order alert emails are fine. It's just the customer order email confirmation which is sending twice.

Any ideas which file I need to check?

Newbie

Posts

Joined
Mon Feb 15, 2021 8:05 am

Post by paulfeakins » Mon Feb 15, 2021 5:42 pm

Are both emails identical?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by j150tfp » Mon Feb 15, 2021 7:14 pm

Hello,

Yes both emails are identical. Literally duplicate.

All other opencart emails are fine. Just the order confirmation that the customer gets has this issue.

Newbie

Posts

Joined
Mon Feb 15, 2021 8:05 am

Post by paulfeakins » Tue Feb 16, 2021 5:08 pm

Very strange, it could be an extension so perhaps you can list all your installed extensions and then try disabling any that seem like they might be affecting these emails?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by j150tfp » Tue Feb 16, 2021 10:37 pm

Hello,
Ok an update: Apart from me being stupid, i've realised, The customer email gets 1 x confirmation and admin gets a EXACT COPY of the customer email (As well as the normal admin order alert mail)

So the customer gets 1 x order confirmation email
Admin gets 2 emails. (1 admin order alert + 1 Exact copy of the customer email)

NO idea why the customer email copy is being sent to admin as in Settings/mail/Additional Alert Mail is BLANK

Apart from installing a Product import/export extension, everything is opencart standard.
I'm using journal 3 theme but my understanding is, this does not usually mess with mail settings or files.

Newbie

Posts

Joined
Mon Feb 15, 2021 8:05 am

Post by parkookk » Thu Aug 01, 2024 9:08 pm

I have the same issue and here is the install.xml that I'm using on OC3038 with SMTP setup.
When customer orders, they get one email and I get two of the identical order recipt.
Any idea what is wrong?

Code: Select all

<modification>
	<name>Customer order confirmation email for store owner</name>
	<version>1.0.1</version>
	<code>coceadmin_fabius_oc3</code>
	<link>mailto:ronca--@gmail.com</link>
	<author>Fabius and Morty</author>
	<file path="catalog/controller/mail/order.php">
		<operation>
			<search index="0"><![CDATA[$data['text_footer'] = $language->get('text_footer');]]></search>
			<add position="after"><![CDATA[$data['text_comment'] = $language->get('text_comment');]]></add>
		</operation>
		<operation>
			<search><![CDATA[if ($order_info['payment_address_format']) {]]></search>
			<add position="before"><![CDATA[if($order_info['comment']) $data['comment'] .= "<br /><br /><strong>". $data['text_comment'] . "</strong><br />" . strip_tags($order_info['comment']);]]></add>
		</operation>
    	<operation>
			<search index="0"><![CDATA[$mail->send();]]></search>
			<add position="after"><![CDATA[
        $mail->setTo($this->config->get('config_email'));
        $mail->send();
      ]]></add>
		</operation>
    	<operation>
			<search><![CDATA[public function alert(&$route, &$args) {]]></search>
			<add position="after"><![CDATA[return;]]></add>
		</operation>
	  	<operation>
			<search><![CDATA[$data['ip'] = $order_info['ip'];]]></search>
			<add position="replace"><![CDATA[]]></add>
		</operation>
	</file>
</modification>
Last edited by parkookk on Thu Oct 03, 2024 10:19 pm, edited 2 times in total.

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by paulfeakins » Fri Aug 02, 2024 7:38 pm

parkookk wrote:
Thu Aug 01, 2024 9:08 pm
Any idea what is wrong?
You could email "Fabius and Morty" their email is in there.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by parkookk » Fri Aug 02, 2024 8:41 pm

Thanks Paul,
This extension use to work fine, I have this problem as soon as I moved to a new server last week. Also most of the email system has issue and my captcha v3 stopped working.
I transferred it by transferring all the files and database from old to new server. Then created the same email addresses, but appareately there is another step to configure the spf etc as I am using a web based email service to send and receive emails.
Also in my dashboard >> Recent section I see the same order apearing twice in a few seconds apart but they have one order number.

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by ADD Creative » Fri Aug 02, 2024 9:45 pm

parkookk wrote:
Fri Aug 02, 2024 8:41 pm
Thanks Paul,
This extension use to work fine, I have this problem as soon as I moved to a new server last week. Also most of the email system has issue and my captcha v3 stopped working.
I transferred it by transferring all the files and database from old to new server. Then created the same email addresses, but appareately there is another step to configure the spf etc as I am using a web based email service to send and receive emails.
Also in my dashboard >> Recent section I see the same order apearing twice in a few seconds apart but they have one order number.
That would suggest that you are getting multiple addOrderHistory events. Check your events and also check both the PHP and OpenCart error logs.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by paulfeakins » Mon Aug 05, 2024 6:33 pm

parkookk wrote:
Fri Aug 02, 2024 8:41 pm
This extension use to work fine, I have this problem as soon as I moved to a new server last week. Also most of the email system has issue and my captcha v3 stopped working.
This is a much better CAPTCHA anyway: https://www.opencart.com/index.php?rout ... er=antropy

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by parkookk » Fri Sep 27, 2024 7:45 pm

paulfeakins wrote:
Mon Aug 05, 2024 6:33 pm
parkookk wrote:
Fri Aug 02, 2024 8:41 pm
This extension use to work fine, I have this problem as soon as I moved to a new server last week. Also most of the email system has issue and my captcha v3 stopped working.
This is a much better CAPTCHA anyway: https://www.opencart.com/index.php?rout ... er=antropy
Thanks, do you think its my reCaptcha extension?

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by parkookk » Fri Sep 27, 2024 11:02 pm

ADD Creative wrote:
Fri Aug 02, 2024 9:45 pm
parkookk wrote:
Fri Aug 02, 2024 8:41 pm
Thanks Paul,
This extension use to work fine, I have this problem as soon as I moved to a new server last week. Also most of the email system has issue and my captcha v3 stopped working.
I transferred it by transferring all the files and database from old to new server. Then created the same email addresses, but appareately there is another step to configure the spf etc as I am using a web based email service to send and receive emails.
Also in my dashboard >> Recent section I see the same order apearing twice in a few seconds apart but they have one order number.
That would suggest that you are getting multiple addOrderHistory events. Check your events and also check both the PHP and OpenCart error logs.
Thanks, I have so many of "d_validator" in my "admin > extensions > events" that in database their Trigger path is admin/view/extension/.
And in my opencart directory the "extension" directory is not in the "view" folder.
And their action path is the same for all; again d_shopunity or d_validator directories don't exist in my OC: extension/d_shopunity/d_validator/view

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by ADD Creative » Sat Sep 28, 2024 1:58 am

parkookk wrote:
Fri Sep 27, 2024 11:02 pm
Thanks, I have so many of "d_validator" in my "admin > extensions > events" that in database their Trigger path is admin/view/extension/.
And in my opencart directory the "extension" directory is not in the "view" folder.
And their action path is the same for all; again d_shopunity or d_validator directories don't exist in my OC: extension/d_shopunity/d_validator/view
If the trigger path start with admin it not going to affect orders on the catalog side.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by parkookk » Mon Sep 30, 2024 10:30 pm

Thanks, there are so many duplicated names in the Event page, this task is going to be very time consuming. What module is controlling this behaiviour so that I can search for it in phpMyadmin?

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by ADD Creative » Tue Oct 01, 2024 4:07 pm

parkookk wrote:
Mon Sep 30, 2024 10:30 pm
Thanks, there are so many duplicated names in the Event page, this task is going to be very time consuming. What module is controlling this behaiviour so that I can search for it in phpMyadmin?
The triggers to look for in oc_event are "catalog/model/checkout/order/addOrderHistory/before". By default there should be event/activity/addOrderHistory, mail/order and mail/order/alert actions. Also "catalog/model/checkout/order/addOrderHistory/after" which should have an event/statistics/addOrderHistory action. You could also check the actions haven't been modified by a modification.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by parkookk » Wed Oct 02, 2024 6:44 pm

Thanks I ran the SQL query below in phpMyadmin>SQL and all looked fine.

Code: Select all

SELECT * FROM `oc_event`
WHERE `trigger` IN (
  'catalog/model/checkout/order/addOrderHistory/before',
  'catalog/model/checkout/order/addOrderHistory/after'
);
However, after deleting these unused events, I placed an order via bank transfer and all looking ok now. So if that happens again I know it's one of my payment modules (PayPal Commerce or Revolut).

Code: Select all

DELETE FROM `oc_event` 
WHERE `code` LIKE 'd_validator%' 
OR `code` LIKE 'd_shopunity%';
Many thanks for your help. :D

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by paulfeakins » Wed Oct 02, 2024 6:55 pm

parkookk wrote:
Wed Oct 02, 2024 6:44 pm
Many thanks for your help. :D
If all is now working, could you add [SOLVED] to the start of this topic title?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by parkookk » Thu Oct 03, 2024 10:17 pm

I just got a new order via PayPal and got two identical message again. What did fixed the problem so far was my other thread about adding the message ID to smtp.php.
You can find the solution here: viewtopic.php?p=873884
.

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london
Who is online

Users browsing this forum: sooty and 12 guests