Page 1 of 1
Edit Order Confirmation in OpenCart 3.0
Posted: Thu Jan 16, 2020 6:24 pm
by andying123
Hi Support.
My Opencart version is 3.0.3.2. I need your help about the Order confirmation email editing
1. I would like to add a "disclaimer text" on the bottom of the order confirmation email template.
However I try edit the "order_add.twig" file ( location: /catalog/view/theme/default/template/mail/) and put the <p> text</p> tag there but the system got no response of my changes and still showing the original confirmation email.
2. The order alert email too simpler to the shop owner, I want to have the same copy of the "order confirmation" as the customer received.
I edited the file "order_alert.twig" ( location: /catalog/view/theme/default/template/mail/), copy and page the same code as the "order_add.twig".
Unfortunately, the alert email content became the raw html code.
I would appreciate if you can help to solve those issues for me at your early convenience.
Many Thanks,
Andy
Re: Edit Order Confirmation in OpenCart 3.0
Posted: Thu Jan 16, 2020 7:43 pm
by letxobnav
1) you may need to clear your theme cache.
2) order alert mails are send as text mail, not html mail so if you put html in there, it will show the markup.
Re: Edit Order Confirmation in OpenCart 3.0
Posted: Fri Jan 17, 2020 7:43 am
by andying123
Hi Support
1. I just followed your advise and cleared the "theme cache" - it works now! Thanks
2. If the "order_alert" only support the plain text, any solution I can get a copy of the "order confirmation" mail which same as customer received?
Best Regards,
Andy
Re: Edit Order Confirmation in OpenCart 3.0
Posted: Fri Jan 17, 2020 8:48 am
by sw!tch
andying123 wrote: ↑Fri Jan 17, 2020 7:43 am
2. If the "order_alert" only support the plain text, any solution I can get a copy of the "order confirmation" mail which same as customer received?
The easiest way without creating a new event or implementing all the logic is to just copy the order email to you.
You can try the below if you want.
catalog/controller/mail/order.php
Find these lines in the public function add method. (around line 278)
Code: Select all
$mail->setHtml($this->load->view('mail/order_add', $data));
$mail->send();
Add AFTER
Code: Select all
// Also send this email to the Store Owner
$mail->setTo($this->config->get('config_email'));
$mail->send();
So your final result should look like this.
Code: Select all
$mail->setHtml($this->load->view('mail/order_add', $data));
$mail->send();
// Also send this email to the Store Owner
$mail->setTo($this->config->get('config_email'));
$mail->send();
This should also send it to the store owner email. Keep in mind some service providers throttle the amount of mail you can send at once, so if it throws an error, that's possibly the reason.
Untested - Backup and try at your own risk.
Re: Edit Order Confirmation in OpenCart 3.0
Posted: Fri Jan 17, 2020 7:11 pm
by andying123
It works! Thanks for the help

Re: Edit Order Confirmation in OpenCart 3.0
Posted: Sun Aug 30, 2020 6:10 pm
by iplocker
Hello.
How about have the option to order_alert.twig
send html code like order_add.twig

So copy paste the content of the order_add to order_alert should work .
PS. Useful extension:
https://www.opencart.com/index.php?rout ... n_id=35844
Thanks
Re: Edit Order Confirmation in OpenCart 3.0
Posted: Mon Sep 21, 2020 5:50 am
by Gordo111
sw!tch wrote: ↑Fri Jan 17, 2020 8:48 am
andying123 wrote: ↑Fri Jan 17, 2020 7:43 am
2. If the "order_alert" only support the plain text, any solution I can get a copy of the "order confirmation" mail which same as customer received?
The easiest way without creating a new event or implementing all the logic is to just copy the order email to you.
You can try the below if you want.
catalog/controller/mail/order.php
Find these lines in the public function add method. (around line 278)
Code: Select all
$mail->setHtml($this->load->view('mail/order_add', $data));
$mail->send();
Add AFTER
Code: Select all
// Also send this email to the Store Owner
$mail->setTo($this->config->get('config_email'));
$mail->send();
So your final result should look like this.
Code: Select all
$mail->setHtml($this->load->view('mail/order_add', $data));
$mail->send();
// Also send this email to the Store Owner
$mail->setTo($this->config->get('config_email'));
$mail->send();
This should also send it to the store owner email. Keep in mind some service providers throttle the amount of mail you can send at once, so if it throws an error, that's possibly the reason.
Untested - Backup and try at your own risk.
This works perfectly!!!
It's wonderfully simple and does the job. For anyone still following this thread, if you want to stop getting 2 emails whenever an order is placed then simply go into your opencart admin, "System->Settings->Mail
Scroll to "Mail Alerts"
Untick the "Orders" in the "Alert Email" area.
No need to load an extension or trawl through loads of code. This has been a massive help.
Thank you!!!
oh and I'm using OC 3.0.3.3 in case that makes any difference.
Re: Edit Order Confirmation in OpenCart 3.0
Posted: Sun Dec 20, 2020 6:21 am
by ronnieb
Following on from this
How do I get the comments to show.
The duplicate Admin email misses them out ? version 3.0.3.6
Re: Edit Order Confirmation in OpenCart 3.0
Posted: Sun Dec 20, 2020 8:35 am
by by mona
Re: Edit Order Confirmation in OpenCart 3.0
Posted: Sun Dec 20, 2020 8:43 am
by sw!tch
ronnieb wrote: ↑Sun Dec 20, 2020 6:21 am
Following on from this
How do I get the comments to show.
The duplicate Admin email misses them out ? version 3.0.3.6
Comments to customers expect notify to be set from addOrderHistory.
If you require additional functionality try the linked extensions or just write a separate event to handle it. There are ways around it, but then this simple solution becomes sloppy.
Re: Edit Order Confirmation in OpenCart 3.0
Posted: Sat Feb 13, 2021 6:07 am
by alejandroalcala
This topic was very useful for me.
In Open Cart 3.0.3.6 works fine.
A little mod in PHP file that change everyting (Admin Side).
Easy to find, insert the code, save, upload and voilá.
THANKS.
Re: Edit Order Confirmation in OpenCart 3.0
Posted: Sun Feb 14, 2021 2:45 am
by kirkhall
Word for word, exact same question asked at
viewtopic.php?f=202&t=222498
mikeinterserv attached an OCMOD to do same FYI.