Post by paulnic777 » Sat Mar 31, 2012 9:05 pm

Hi,

In the old OC (1.4.xx) i used to receive an order confirmation email which looked very similar to the email that is sent to the customer which shows billing address, delivery address and products etc. Now in OC v1.5.2.1 all i get is an email similar to below:

You have received an order.

Order ID: 248
Date Added: 25/03/2012
Order Status: Complete

Products
1x Nike air max trainer £99.99

Order Totals
Sub-Total: £99.99
Free Shipping: £0.00
Total: £99.99


This means that i have to log into the admin section to find delivery addresses etc. Is there a setting i am missing to duplicate the email sent to the customer??

New member

Posts

Joined
Fri Jul 02, 2010 1:42 am

Post by paulnic777 » Sun Apr 01, 2012 4:51 pm

anybody?

New member

Posts

Joined
Fri Jul 02, 2010 1:42 am

Post by jim_jay » Tue Apr 03, 2012 3:19 am

iam getting the same surely some knows why this is happening was ok on 1.5.1.2 now on 1.5.2.1 its same as above
any help sorting this out please

Newbie

Posts

Joined
Mon Sep 19, 2011 11:00 pm

Post by colt1911 » Tue Apr 03, 2012 8:06 am

Did anyone figure this out? My client wants this too...

New member

Posts

Joined
Sat Sep 24, 2011 1:23 am

Post by Avvici » Tue Apr 03, 2012 1:01 pm

paulnic777 wrote:Hi,

In the old OC (1.4.xx) i used to receive an order confirmation email which looked very similar to the email that is sent to the customer which shows billing address, delivery address and products etc. Now in OC v1.5.2.1 all i get is an email similar to below:

You have received an order.

Order ID: 248
Date Added: 25/03/2012
Order Status: Complete

Products
1x Nike air max trainer £99.99

Order Totals
Sub-Total: £99.99
Free Shipping: £0.00
Total: £99.99


This means that i have to log into the admin section to find delivery addresses etc. Is there a setting i am missing to duplicate the email sent to the customer??

Go to this file: catalog/model/checkout/order.php

Find this line of code: (which is the confirmation function)

Code: Select all

public function confirm($order_id, $order_status_id, $comment = '', $notify = false) {
Inside that function look for this line of code:

Code: Select all

// Admin Alert Mail
			if ($this->config->get('config_alert_mail')) {
You have not told us exactly what you want to show on the admin email but this is where you would add those parameters to the email code.
Find this line of code

Code: Select all

$text .= $language->get('text_new_order_id') . ' ' . $order_id . "\n";
and add your new parameters below that like this:

Code: Select all

$text .= $language->get('text_new_order_id') . ' ' . $order_id . "\n";
				$text .= "Customer Name" . ' ' . $new_variable_name . "\n";
				$text .= "Customer Address" . ' ' . $new_variable_address . "\n";
				$text .= "Customer Telephone" . ' ' . $new_variable_telephone . "\n";
				$text .= "Customer Email" . ' ' . $new_variable_email . "\n";

Make a back up before you start messing. You MUST replace the dummy variables with actual variables such as"$new_variable_name" for this to work. I just wanted to get you started.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by colt1911 » Tue Apr 03, 2012 10:00 pm

@avvici - Thank you!!

New member

Posts

Joined
Sat Sep 24, 2011 1:23 am

Post by niquey » Wed Apr 04, 2012 3:29 am

Hi, I'm sorry but I don't understand how to replace the variables? I've tried few different things but nothing seems to work, are you able to post the code?
Thanks very much

Newbie

Posts

Joined
Wed Apr 04, 2012 3:27 am

Post by jim_jay » Wed Apr 04, 2012 3:40 am

paulnic777 wrote:Hi,

In the old OC (1.4.xx) i used to receive an order confirmation email which looked very similar to the email that is sent to the customer which shows billing address, delivery address and products etc. Now in OC v1.5.2.1 all i get is an email similar to below:

You have received an order.

Order ID: 248
Date Added: 25/03/2012
Order Status: Complete

Products
1x Nike air max trainer £99.99

Order Totals
Sub-Total: £99.99
Free Shipping: £0.00
Total: £99.99


This means that i have to log into the admin section to find delivery addresses etc. Is there a setting i am missing to duplicate the email sent to the customer??

ok i had same problem this is how i fixed it

Go to this file: catalog/model/checkout/order.php
look for this bit of code under //Admin Alert Mail

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(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
				$mail->setText(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));
				$mail->send();
replace with this

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(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
				$mail->setHtml($html);
				$mail->setText(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));
				$mail->send();
before
Untitled.jpg

Untitled.jpg (25.17 KiB) Viewed 13185 times


after
Untitled1.png

Untitled1.png (73.72 KiB) Viewed 13185 times


Newbie

Posts

Joined
Mon Sep 19, 2011 11:00 pm

Post by spirit » Wed Apr 04, 2012 5:07 am

paulnic777 wrote:Hi,

In the old OC (1.4.xx) i used to receive an order confirmation email which looked very similar to the email that is sent to the customer which shows billing address, delivery address and products etc. Now in OC v1.5.2.1 all i get is an email similar to below:

You have received an order.

Order ID: 248
Date Added: 25/03/2012
Order Status: Complete

Products
1x Nike air max trainer £99.99

Order Totals
Sub-Total: £99.99
Free Shipping: £0.00
Total: £99.99


This means that i have to log into the admin section to find delivery addresses etc. Is there a setting i am missing to duplicate the email sent to the customer??
This was the best way for me, try it http://forum.opencart.com/viewtopic.php?f=131&t=43539
Cheers! :)

Active Member

Posts

Joined
Sat Oct 02, 2010 7:40 am

Post by Avvici » Wed Apr 04, 2012 2:04 pm

That was smart thinking to add the existing: $mail->setHtml($html);

Nice job :crazy:

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by snajperista » Tue Jun 05, 2012 7:41 pm

This I succeeded but I was still a problem because we need a simple e-mail that will be coming admin. This is the default one that suits me perfectly just do not know how to add addresses to napaltu and delivery. Pray your help we

Newbie

Posts

Joined
Mon May 21, 2012 7:43 am

Post by pconic » Tue Jul 03, 2012 9:10 am

Hi

Mine work fine but the image for logo is not showing up

New member

Posts

Joined
Tue Oct 25, 2011 4:29 am

Post by ronnietx » Sat Nov 17, 2012 12:54 am

anyone ever figure this shit out so it works in 1.5.1.3 ?

New member

Posts

Joined
Thu Jul 30, 2009 2:23 am

Post by fleep » Mon Nov 26, 2012 10:35 pm

Just wanted to say thank you for this code, worked like a charm for me. Thanks for the help! :)

Newbie

Posts

Joined
Sun Apr 29, 2012 12:02 pm

Post by zemox » Fri Dec 06, 2013 4:24 pm

hi thx for code. but; both customer and admin does not appear order comments in mail. how can i add comments code?

Newbie

Posts

Joined
Fri Dec 06, 2013 4:17 pm

User avatar
Active Member

Posts

Joined
Sat Aug 31, 2013 10:19 pm
Who is online

Users browsing this forum: No registered users and 33 guests