Page 1 of 2
<SOLVED> HTML Admin Email With Comments
Posted: Wed Jun 15, 2011 5:23 pm
by ronnieb
Can this be intergrated into 1.5
the admin order confirmation doesn't show any addresses
Thanks
Re: Enhanced Order Email 1.5
Posted: Wed Jun 15, 2011 7:09 pm
by opencart-templates
This extension may be of interest to you:
http://www.opencart.com/index.php?route ... on_id=2221
Includes
- - Customer Registers HTML Email
- Order Email to Customer and Admin
- Update Order notify Customer
- Newsletter HTML layout/background
Re: Enhanced Order Email 1.5
Posted: Wed Jun 15, 2011 11:01 pm
by Qphoria
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)
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();
Re: Enhanced Order Email 1.5
Posted: Thu Jun 16, 2011 2:33 am
by i2Paq
Thanks! and bookmarked!
Re: Enhanced Order Email 1.5
Posted: Thu Jun 16, 2011 5:24 am
by ronnieb
Thankyou
Perfect !!
Ronnie
Re: Enhanced Order Email 1.5
Posted: Sat Jun 18, 2011 6:59 pm
by ronnieb
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
Re: <SOLVED> Enhanced Order Email 1.5
Posted: Sat Jun 18, 2011 11:26 pm
by ronnieb
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
Re: <SOLVED> HTML Admin Email With Comments
Posted: Fri Aug 12, 2011 8:55 am
by peterman
this works well!!
Thanks
Re: <SOLVED> HTML Admin Email With Comments
Posted: Sun Aug 14, 2011 1:48 pm
by onlinemarketer
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!)
Re: <SOLVED> Enhanced Order Email 1.5
Posted: Wed Aug 17, 2011 12:00 am
by rampitt
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

Re: <SOLVED> HTML Admin Email With Comments
Posted: Sun Sep 11, 2011 11:29 am
by onlinemarketer
Is it just me? I seem to be getting the default store logo appearing on sub store order confirmation emails!
Re: <SOLVED> HTML Admin Email With Comments
Posted: Sun Sep 11, 2011 6:58 pm
by onlinemarketer
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!
Re: Enhanced Order Email 1.5
Posted: Wed Oct 12, 2011 7:27 pm
by feed
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?

Re: Enhanced Order Email 1.5
Posted: Wed Oct 19, 2011 6:22 pm
by aide2001
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?
Re: <SOLVED> HTML Admin Email With Comments
Posted: Wed Oct 19, 2011 11:43 pm
by joy
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.
Re: Enhanced Order Email 1.5
Posted: Thu Oct 20, 2011 4:02 pm
by aide2001
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
Re: Enhanced Order Email 1.5
Posted: Thu Oct 20, 2011 5:35 pm
by opencart-templates
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>
Enhanced Order Email
Posted: Thu Oct 20, 2011 7:54 pm
by aide2001
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
Re: Enhanced Order Email 1.5
Posted: Tue Dec 06, 2011 4:01 pm
by wizardhomefitness.
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?
Re: <SOLVED> HTML Admin Email With Comments
Posted: Tue Dec 06, 2011 11:27 pm
by notaprogrammer
THANK YOU!!