Community Forums

<SOLVED> HTML Admin Email With Comments

Enter all OpenCart 1.x feature requests here. One idea per topic. Please search the forum to see if your feature has already been requested

<SOLVED> HTML Admin Email With Comments

Postby ronnieb » Wed Jun 15, 2011 9:23 am

Can this be intergrated into 1.5

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

Postby opencart-templates » Wed Jun 15, 2011 11:09 am

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
User avatar
opencart-templates
 
Posts: 107
Joined: Mon May 16, 2011 11:24 am
Location: UK

Re: Enhanced Order Email 1.5

Postby Qphoria » Wed Jun 15, 2011 3:01 pm

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();
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18197
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: Enhanced Order Email 1.5

Postby i2Paq » Wed Jun 15, 2011 6:33 pm

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.
User avatar
i2Paq
Global Moderator
 
Posts: 9748
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: Enhanced Order Email 1.5

Postby ronnieb » Wed Jun 15, 2011 9:24 pm

Thankyou
Perfect !!


Ronnie
ronnieb
 
Posts: 74
Joined: Tue May 24, 2011 7:44 am

Re: Enhanced Order Email 1.5

Postby ronnieb » Sat Jun 18, 2011 10:59 am

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
ronnieb
 
Posts: 74
Joined: Tue May 24, 2011 7:44 am

Re: <SOLVED> Enhanced Order Email 1.5

Postby ronnieb » Sat Jun 18, 2011 3:26 pm

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
Attachments
comments.zip
(6.27 KiB) Downloaded 752 times
ronnieb
 
Posts: 74
Joined: Tue May 24, 2011 7:44 am

Re: <SOLVED> HTML Admin Email With Comments

Postby peterman » Fri Aug 12, 2011 12:55 am

this works well!!

Thanks
Peter Sesselmann
Acoustic Stompboxes and Guitar Pickups, Art
http://www.peterman.com.au
User avatar
peterman
 
Posts: 9
Joined: Fri Jun 18, 2010 11:14 pm
Location: Australia

Re: <SOLVED> HTML Admin Email With Comments

Postby onlinemarketer » Sun Aug 14, 2011 5:48 am

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

Postby rampitt » Tue Aug 16, 2011 4:00 pm

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 :crazy:
rampitt
 
Posts: 1
Joined: Tue Aug 16, 2011 3:57 pm

Re: <SOLVED> HTML Admin Email With Comments

Postby onlinemarketer » Sun Sep 11, 2011 3:29 am

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

Postby onlinemarketer » Sun Sep 11, 2011 10:58 am

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

Postby feed » Wed Oct 12, 2011 11:27 am

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 :)
User avatar
feed
 
Posts: 32
Joined: Thu Jun 10, 2010 9:21 pm

Re: Enhanced Order Email 1.5

Postby aide2001 » Wed Oct 19, 2011 10:22 am

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?
Live long my friends
visit our website now at http://www.less2websites.com
aide2001
 
Posts: 15
Joined: Wed Mar 30, 2011 9:11 am

Re: <SOLVED> HTML Admin Email With Comments

Postby joy » Wed Oct 19, 2011 3:43 pm

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

Postby aide2001 » Thu Oct 20, 2011 8:02 am

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
Live long my friends
visit our website now at http://www.less2websites.com
aide2001
 
Posts: 15
Joined: Wed Mar 30, 2011 9:11 am

Re: Enhanced Order Email 1.5

Postby opencart-templates » Thu Oct 20, 2011 9:35 am

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>
User avatar
opencart-templates
 
Posts: 107
Joined: Mon May 16, 2011 11:24 am
Location: UK

Enhanced Order Email

Postby aide2001 » Thu Oct 20, 2011 11:54 am

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
Last edited by aide2001 on Sat Dec 17, 2011 3:33 pm, edited 1 time in total.
Live long my friends
visit our website now at http://www.less2websites.com
aide2001
 
Posts: 15
Joined: Wed Mar 30, 2011 9:11 am

Re: Enhanced Order Email 1.5

Postby wizardhomefitness. » Tue Dec 06, 2011 8:01 am

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
wizardhomefitness.
 
Posts: 79
Joined: Tue Aug 03, 2010 6:53 am

Re: <SOLVED> HTML Admin Email With Comments

Postby notaprogrammer » Tue Dec 06, 2011 3:27 pm

THANK YOU!!
notaprogrammer
 
Posts: 17
Joined: Fri Dec 02, 2011 10:33 pm

Next

Return to Feature Requests

Who is online

Users browsing this forum: DudiQ, elisaf and 7 guests

Hosted by Arvixe Web Hosting