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
2) order alert mails are send as text mail, not html mail so if you put html in there, it will show the markup.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
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
The easiest way without creating a new event or implementing all the logic is to just copy the order email to you.andying123 wrote: ↑Fri Jan 17, 2020 7:43 am2. 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?
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();
Code: Select all
// Also send this email to the Store Owner
$mail->setTo($this->config->get('config_email'));
$mail->send();
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();
Untested - Backup and try at your own risk.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
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
This works perfectly!!!sw!tch wrote: ↑Fri Jan 17, 2020 8:48 amThe easiest way without creating a new event or implementing all the logic is to just copy the order email to you.andying123 wrote: ↑Fri Jan 17, 2020 7:43 am2. 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?
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)Add AFTERCode: Select all
$mail->setHtml($this->load->view('mail/order_add', $data)); $mail->send();
So your final result should look like this.Code: Select all
// 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.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();
Untested - Backup and try at your own risk.
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.
https://www.opencart.com/index.php?rout ... n_id=32499

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
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.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
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.
mikeinterserv attached an OCMOD to do same FYI.
Users browsing this forum: No registered users and 71 guests