<SOLVED> HTML Admin Email With Comments
37 posts
• Page 1 of 2 • 1, 2
<SOLVED> HTML Admin Email With Comments
Can this be intergrated into 1.5
the admin order confirmation doesn't show any addresses
Thanks
the admin order confirmation doesn't show any addresses
Thanks
Last edited by ronnieb on Sat Jun 18, 2011 3:57 pm, edited 1 time in total.
- ronnieb
- Posts: 74
- Joined: Tue May 24, 2011 7:44 am
Re: Enhanced Order Email 1.5
This extension may be of interest to you: http://www.opencart.com/index.php?route ... on_id=2221
Includes
Includes
- - Customer Registers HTML Email
- Order Email to Customer and Admin
- Update Order notify Customer
- Newsletter HTML layout/background
-

opencart-templates - Posts: 107
- Joined: Mon May 16, 2011 11:24 am
- Location: UK
Re: Enhanced Order Email 1.5
To make 1.5.x work more like 1.4.x that sends the same email to the admin as the customer.
Do the following....
(1.5.x ONLY!)
1. EDIT: catalog/model/checkout/order.php
2. FIND (~LINES 475 - 488) (Be sure its under the "// Admin Alert Mail" line)
3. REPLACE WITH:
Do the following....
(1.5.x ONLY!)
1. EDIT: catalog/model/checkout/order.php
2. FIND (~LINES 475 - 488) (Be sure its under the "// Admin Alert Mail" line)
- Code: Select all
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($order_info['store_name']);
$mail->setSubject($subject);
$mail->setText($text);
$mail->send();
3. REPLACE WITH:
- Code: Select all
// HTML
$template->data['text_greeting'] = $language->get('text_new_received') . "\n\n";
$template->data['invoice_no'] = '';
$template->data['text_invoice_no'] = '';
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/order.tpl')) {
$html = $template->fetch($this->config->get('config_template') . '/template/mail/order.tpl');
} else {
$html = $template->fetch('default/template/mail/order.tpl');
}
$subject = sprintf($language->get('text_new_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'), $order_id . ' (' . $order_total . ')');
$mail->setSubject($subject);
$mail->setTo($this->config->get('config_email'));
$mail->setHtml($html);
$mail->send();

Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
-

Qphoria - Administrator
- Posts: 18213
- Joined: Mon Jul 21, 2008 7:02 pm

Re: Enhanced Order Email 1.5
Thanks! and bookmarked!
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
First Things First: Opencart Check List.
Documentation: Our Documentation section.
BUGs?: Known BUGS for All OC Versions.
Problemen met de BTW?: [How to] BTW + Verzend & betaalmethodes.
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
First Things First: Opencart Check List.
Documentation: Our Documentation section.
BUGs?: Known BUGS for All OC Versions.
Problemen met de BTW?: [How to] BTW + Verzend & betaalmethodes.
-

i2Paq - Global Moderator
- Posts: 9775
- Joined: Mon Nov 09, 2009 11:00 am
- Location: Winkel - The Netherlands
Re: Enhanced Order Email 1.5
Thankyou
Perfect !!
Ronnie
Perfect !!
Ronnie
- ronnieb
- Posts: 74
- Joined: Tue May 24, 2011 7:44 am
Re: Enhanced Order Email 1.5
One other question ...
Changing the above code means that there isn't any comments added to the email (admin or customer)
what do i need to add to get them included ?
Thanks
Ronnie
Changing the above code means that there isn't any comments added to the email (admin or customer)
what do i need to add to get them included ?
Thanks
Ronnie
- ronnieb
- Posts: 74
- Joined: Tue May 24, 2011 7:44 am
Re: <SOLVED> Enhanced Order Email 1.5
OK
Spent ages figuring it out - Im not a programmer so please backup your files if you use this method.
I have attached the 2 files that have been changed
1) catalog/model/checkout/order.php
2) catalog/view/theme/default/template/mail/order.tpl
this will add the comments to your admin order email and the customers order email.
The fix above by qphoria is included in the catalog/model/checkout/order.php.
so by overwriting the files, no further action needs to be taken.
Ronnie
Spent ages figuring it out - Im not a programmer so please backup your files if you use this method.
I have attached the 2 files that have been changed
1) catalog/model/checkout/order.php
2) catalog/view/theme/default/template/mail/order.tpl
this will add the comments to your admin order email and the customers order email.
The fix above by qphoria is included in the catalog/model/checkout/order.php.
so by overwriting the files, no further action needs to be taken.
Ronnie
- Attachments
-
comments.zip- (6.27 KiB) Downloaded 756 times
- ronnieb
- Posts: 74
- Joined: Tue May 24, 2011 7:44 am
Re: <SOLVED> HTML Admin Email With Comments
this works well!!
Thanks
Thanks
-

peterman - Posts: 9
- Joined: Fri Jun 18, 2010 11:14 pm
- Location: Australia
Re: <SOLVED> HTML Admin Email With Comments
is it possible to get a VQMod of this enhancement, or can VQMod not be used for entire files? (dont shoot! im new to php and vqmod!)
- onlinemarketer
- Posts: 84
- Joined: Sat May 14, 2011 12:21 pm
Re: <SOLVED> Enhanced Order Email 1.5
ronnieb wrote:OK
Spent ages figuring it out - Im not a programmer so please backup your files if you use this method.
I have attached the 2 files that have been changed
1) catalog/model/checkout/order.php
2) catalog/view/theme/default/template/mail/order.tpl
this will add the comments to your admin order email and the customers order email.
The fix above by qphoria is included in the catalog/model/checkout/order.php.
so by overwriting the files, no further action needs to be taken.
Ronnie
Thanks so much Ronnie!! You saved me from my "harassing" client who can't understand why I can't fix it

- rampitt
- Posts: 1
- Joined: Tue Aug 16, 2011 3:57 pm
Re: <SOLVED> HTML Admin Email With Comments
Is it just me? I seem to be getting the default store logo appearing on sub store order confirmation emails!
- onlinemarketer
- Posts: 84
- Joined: Sat May 14, 2011 12:21 pm
Re: <SOLVED> HTML Admin Email With Comments
This is weird, the order email from a sub store uses it's own logo banner if the order is in gbp but reverts to the default store logo if the order us in usd!
- onlinemarketer
- Posts: 84
- Joined: Sat May 14, 2011 12:21 pm
Re: Enhanced Order Email 1.5
Qphoria wrote:For the 1.4.x version that sends the same email to the admin as the customer.
(1.5.x ONLY!)
1. EDIT: catalog/model/checkout/order.php
2. FIND (~LINES 475 - 488) (Be sure its under the "// Admin Alert Mail" line)
- Code: Select all
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($order_info['store_name']);
$mail->setSubject($subject);
$mail->setText($text);
$mail->send();
3. REPLACE WITH:
- Code: Select all
// HTML
$template->data['text_greeting'] = $language->get('text_new_received') . "\n\n";
$template->data['invoice_no'] = '';
$template->data['text_invoice_no'] = '';
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/order.tpl')) {
$html = $template->fetch($this->config->get('config_template') . '/template/mail/order.tpl');
} else {
$html = $template->fetch('default/template/mail/order.tpl');
}
$subject = sprintf($language->get('text_new_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'), $order_id . ' (' . $order_total . ')');
$mail->setSubject($subject);
$mail->setTo($this->config->get('config_email'));
$mail->setHtml($html);
$mail->send();
Yes, It works but then the email title is:
SHOP NAME - Order XX (Array)
How do I remove that (Array) in the email tittle since it does not make any sense?

Please try my Free and real time web translator made with Google API. and let me know what ya think 

-

feed - Posts: 32
- Joined: Thu Jun 10, 2010 9:21 pm
Re: Enhanced Order Email 1.5
Hi there people, the code that was posted works well, I would like to know how to get the customers name on the subject line instead of maybe the total price?
- aide2001
- Posts: 15
- Joined: Wed Mar 30, 2011 9:11 am
Re: <SOLVED> HTML Admin Email With Comments
Another easier solution is to have an exact copy of the customer email on new order. On the same thread also have solutions for adding the Order Status and Customer Comments to the email too.
OC version 1.5.1.3
- joy
- Posts: 23
- Joined: Fri Oct 14, 2011 1:18 am
Re: Enhanced Order Email 1.5
Yes that works too, but I still would like the customers name in the subject line instead of the total order, or maybe both name and total. The name is more important to me than the total order, anyone got any ideas on the php scripting of mod catalog/model/checkout/order.php
Cheers
Cheers
- aide2001
- Posts: 15
- Joined: Wed Mar 30, 2011 9:11 am
Re: Enhanced Order Email 1.5
aide2001 wrote:Yes that works too, but I still would like the customers name in the subject line instead of the total order, or maybe both name and total. The name is more important to me than the total order, anyone got any ideas on the php scripting of mod catalog/model/checkout/order.php
Cheers
This should work and change the subject to "Ben Smith, thank you for your order(ID:11) with Your Store"
FILE: catalog/language/english/mail/order.php
FIND:
$_['text_new_subject'] = '%s - Order %s';
REPLACE:
$_['text_new_subject'] = '%s thank you for your order(ID:%s) with %s';
- Code: Select all
<operation>
<search position="after"><![CDATA[
$subject = sprintf($language->get('text_new_subject'), $order_info['store_name'], $order_id);
]]></search>
<add><![CDATA[
// Load customer
$this->load->model('account/customer');
$customer = $this->module_account_customer->getCustomer($order_info['customer_id']);
// Merge first and last name
$full_name = $customer['firstname'] . ' ' . $customer['lastname'];
$subject = sprintf($language->get('text_new_subject'), $full_name, $order_id, $order_info['store_name']);
]]></add>
</operation>
-

opencart-templates - Posts: 107
- Joined: Mon May 16, 2011 11:24 am
- Location: UK
Enhanced Order Email
Thank you for that, one more question, do I remove the 1st
$subject = sprintf($language->get('text_new_subject'), $order_info['store_name'], $order_id);
and replace with all the other php script??
Okay tried both ways, and no email admin comes through, so put back to normal for now and to see if anyone else can come up with the script
$subject = sprintf($language->get('text_new_subject'), $order_info['store_name'], $order_id);
and replace with all the other php script??
Okay tried both ways, and no email admin comes through, so put back to normal for now and to see if anyone else can come up with the script
Last edited by aide2001 on Sat Dec 17, 2011 3:33 pm, edited 1 time in total.
- aide2001
- Posts: 15
- Joined: Wed Mar 30, 2011 9:11 am
Re: Enhanced Order Email 1.5
Yes, It works but then the email title is:
SHOP NAME - Order XX (Array)
How do I remove that (Array) in the email tittle since it does not make any sense?
I am having this same problem, the HTML email confirmation is working great apart from the fact that '(Array)' is being added to the end of the subject line. Is there any way to change this?
Gym Equipment Online Store
http://www.wizardhomefitness.com.au
----------------------------------------------------
Fresh Kicks Online Sneaker & Clothing Store
http://www.freshkicks.com.au
http://www.wizardhomefitness.com.au
----------------------------------------------------
Fresh Kicks Online Sneaker & Clothing Store
http://www.freshkicks.com.au
- wizardhomefitness.
- Posts: 79
- Joined: Tue Aug 03, 2010 6:53 am
Re: <SOLVED> HTML Admin Email With Comments
THANK YOU!!
- notaprogrammer
- Posts: 17
- Joined: Fri Dec 02, 2011 10:33 pm
37 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 4 guests














