Jump to content
Sign in to follow this  
Elazar

[contribution] Send_order_html_email

Recommended Posts

Hi

 

What was changed in checkout_process.php to get cheque payemnts to display? I can't find it.

Never mind.

How do you get the comments to show in the check out email?


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Only as subject not as "from-field" .

 

like

 

Order Ordernummer xyz from testuser@testmail.com

 

therefore you have to change

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT .' ' .EMAIL_TEXT_ORDER_NUMBER.' '. 
$insert_id , nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');

to 

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT .' ' .EMAIL_TEXT_ORDER_NUMBER.' '. 
$insert_id .'from '. $order->customer['email_address'],  nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');

 

Hi Shetani,

 

How r you?

 

I understood your suggestion, but I really need that appear the customers name in the from field, because I intend to use the mail programa, like OE, to control payments, so, to find a specific order that we don't know the number, we will look for for the name of the customer. The orders that customers receive from store, will continue to show the store name, but the copys that I'll receive, appears as the customer had sent me directly.

 

The contribution HTML Invoice allow this, but I prefer to use you contribution because I liked the layout

 

Thanks

 

Renato

Share this post


Link to post
Share on other sites

OK Renato,

 

here we go - late but not too late (sun is shinning :))

 

look for

 

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT .' ' .EMAIL_TEXT_ORDER_NUMBER.' '. 
$insert_id , nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');

and change 

STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS

to 

$order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address']

that way, that the whole code looks like

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT.' '.EMAIL_TEXT_ORDER_NUMBER .' '. 
$insert_id, nl2br($email_order), $order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], '');

 

That should work. If you would also like to have a different EMAIL_TEXT_SUBJECT then you have to define it in the language section and substitute

within the above code snippet

 

Greets Frank

Edited by shetani

Share this post


Link to post
Share on other sites
Never mind.

How do you get the comments to show in the check out email?

 

Seems that the original code

 

  if ($order->info['comments']) {
+    $email_order .= tep_db_output($order->info['comments']) . "\n\n";

 

was not included in the HTML Email V2 contrib.

 

Normally, you can fix it if you modify the modules/email/html_checkout_process.php the following way

 

Find

... $Vartaxe</td>";
$html_email_order .= "        	</tr>";
$html_email_order .= "      </table></td>";
$html_email_order .= "  </tr>";

 

and paste in direct after

 

if ($order->info['comments']) {
$html_email_order .= "  <tr>";
$html_email_order .= "		 <td><table width=\"600\"  border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=white>";
$html_email_order .= "        	<tr> ";
$html_email_order .= "         		<td class=\"boxmail\">$Varcommenttext</td>";
$html_email_order .= "        	</tr>";
$html_email_order .= "       	 <tr> ";
$html_email_order .= "          	<td class=\"boxmailgris\">$Varcomment</td> ";
$html_email_order .= "        	</tr>";
$html_email_order .= "       </table></td>";
$html_email_order .= " 	</tr>";};

 

Save and upload file (Backup before ;))

 

then open checkout_process.php and find

 

$Varhttp = ''.VARHTTP.'';
$Varstyle = ''.VARSTYLE.'';
$Varshipaddress =''.tep_address_label($customer_id, $sendto).'';

 

paste the following code direct behind the last line

 

$Varcommenttext =''.EMAIL_TEXT_COMMENT.'';
if ($order->info['comments'])
$Varcomment =''.tep_db_output($order->info['comments']).'';

 

last but not least you have to define the EMAIL_TEXT_COMMENT in the admin language section (checkout_process)

define('EMAIL_TEXT_COMMENT', 'Comment');

Edited by shetani

Share this post


Link to post
Share on other sites
OK Renato,

 

here we go - late but not too late (sun is shinning :))

 

look for

 

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT .' ' .EMAIL_TEXT_ORDER_NUMBER.' '. 
$insert_id , nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');

and change 

STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS

to 

$order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address']

that way, that the whole code looks like

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT.' '.EMAIL_TEXT_ORDER_NUMBER .' '. 
$insert_id, nl2br($email_order), $order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], '');

 

That should work. If you would also like to have a different EMAIL_TEXT_SUBJECT then you have to define it in the language section and substitute

within the above code snippet

 

Greets Frank

 

Hi Frank,

 

Thanks for the answer and for your patience too

 

Sorry, but not works to me. The result is the same that previous solution.

 

Thanks

 

Renato

Share this post


Link to post
Share on other sites

Hi Renato,

 

normally it should work.

 

Have you changed the code in the checkout process.php

 


tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT .' ' .EMAIL_TEXT_ORDER_NUMBER.' '. 
$insert_id , nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');

to

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT.' '.EMAIL_TEXT_ORDER_NUMBER .' '. 
$insert_id, nl2br($email_order), $order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], '');

 

?!

 

Take care that you have changed the right one - that one which includes the SEND_EXTRA_ORDER_EMAILS_TO field

 

I´ve made the same changes here and it works perfect.

Edited by shetani

Share this post


Link to post
Share on other sites

My dear friend. Everything is all right now. Thanks a lot and congratulations to this very nice contribution. Best regards.

Edited by rdbello

Share this post


Link to post
Share on other sites
My dear friend. Everything is all right now. Thanks a lot and congratulations to this very nice contribution. Best regards.

 

I would also thank the author of this nice contribution for his excellent work ;)

Share this post


Link to post
Share on other sites
Seems that the original code

 

  if ($order->info['comments']) {
+    $email_order .= tep_db_output($order->info['comments']) . "\n\n";

 

was not included in the HTML Email V2 contrib.

 

Normally, you can fix it if you modify the modules/email/html_checkout_process.php the following way

 

Find

... $Vartaxe</td>";
$html_email_order .= "        	</tr>";
$html_email_order .= "      </table></td>";
$html_email_order .= "  </tr>";

 

and paste in direct after

 

if ($order->info['comments']) {
$html_email_order .= "  <tr>";
$html_email_order .= "		 <td><table width=\"600\"  border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=white>";
$html_email_order .= "        	<tr> ";
$html_email_order .= "         		<td class=\"boxmail\">$Varcommenttext</td>";
$html_email_order .= "        	</tr>";
$html_email_order .= "       	 <tr> ";
$html_email_order .= "          	<td class=\"boxmailgris\">$Varcomment</td> ";
$html_email_order .= "        	</tr>";
$html_email_order .= "       </table></td>";
$html_email_order .= " 	</tr>";};

 

Save and upload file (Backup before ;))

 

then open checkout_process.php and find

 

$Varhttp = ''.VARHTTP.'';
$Varstyle = ''.VARSTYLE.'';
$Varshipaddress =''.tep_address_label($customer_id, $sendto).'';

 

paste the following code direct behind the last line

 

$Varcommenttext =''.EMAIL_TEXT_COMMENT.'';
if ($order->info['comments'])
$Varcomment =''.tep_db_output($order->info['comments']).'';

 

last but not least you have to define the EMAIL_TEXT_COMMENT in the admin language section (checkout_process)

define('EMAIL_TEXT_COMMENT', 'Comment');

Hi Frank

 

Thank you, thank you. That worked perfectly. Now I just need to go back and get my payment method showing in the email.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Hi Frank

 

Thank you, thank you. That worked perfectly. Now I just need to go back and get my payment method showing in the email.

Anyone else have the problem of the payment method not appearing in the checkout email?


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Anyone else have the problem of the payment method not appearing in the checkout email?

OK then. Anyone know how to get this working with purchase without account?


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
OK then. Anyone know how to get this working with purchase without account?

OK then. Anyone know how to get this CONTRIBUTION working with purchase without account?


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
OK then. Anyone know how to get this CONTRIBUTION working with purchase without account?

Is any one having a problem getting the payment method showing in the checkout email when using php 5 ?


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Is any one having a problem getting the payment method showing in the checkout email when using php 5 ?

Apparently not a php 5 issues since I did

http://svn.oscommerce.com/fisheye/changelo...mmerce/?cs=1583

 

http://svn.oscommerce.com/fisheye/changelo...mmerce/?cs=1584

 

Anyway, it looks like I am talking to myself again, so I will stop.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

I´m sorry.

 

We are running 3 shops today 2 of them under PHP Version 4.3.10-16 and one on PHP Version 5.1.2

 

By end of the week i will go forward and patch the php 5 machine to work with send html emails.

After then i will be able to give you my statement about possible issues with php5.

 

Meanwhile , if you are interested in, you can send me your checkout_process.php for revising.

Share this post


Link to post
Share on other sites

The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

What happened if you chose a different payment method instead of PWA ?!

 

Does the email contains the right information then ?

Share this post


Link to post
Share on other sites

What happened if you chose a different payment method instead of PWA ?!

 

Does the email contains the right information then ?

 

I dont know the PWA contrib . The email text for payment method is the $payment_class->title.

If i´m right their isnt a payment_class for PWA and if so their isnt also a title for that defined.

 

The only way to fix it may be to change in the checkout_process.php

 

Varmodpay .= $payment_class->title . "\n"; to something like

 

if ($payment_class->title == '') {Varmodpay .= $order->info['payment_method']."\n";}
else{Varmodpay .= $payment_class->title . "\n"; } 

Edited by shetani

Share this post


Link to post
Share on other sites
What happened if you chose a different payment method instead of PWA ?!

 

Does the email contains the right information then ?

Hi Frank

 

PWA is not a payment method, it is payment without account (the customer does not need to create an account in the shop).


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Hi Frank

 

PWA is not a payment method, it is payment without account (the customer does not need to create an account in the shop).

 

 

OK, then the reason is the one described above.

 

The only way to fix it may be to change in the checkout_process.php

 

$Varmodpay .= $payment_class->title . "\n"; to something like

 

 

if ($payment_class->title == '') {$Varmodpay .= $order->info['payment_method']."\n";}
else{$Varmodpay .= $payment_class->title . "\n"; } ;

Edited by shetani

Share this post


Link to post
Share on other sites
OK, then the reason is the one described above.

 

The only way to fix it may be to change in the checkout_process.php

 

$Varmodpay .= $payment_class->title . "\n"; to something like

if ($payment_class->title == '') {$Varmodpay .= $order->info['payment_method']."\n";}
else{$Varmodpay .= $payment_class->title . "\n"; } ;

Hi Frank

 

Thank you for helping.

 

Just to explain why PWA is there - it is solely to stop the url for the order from appearing in the email if the customer is a PWA customer.

 

 

I tried the code but the result is exactly the same. The code should work from what I can see. I will set up a clean install over the weekend, and try this contrib on its own on the test server.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

Make sense ;)

 

You can take a look in the database table orders where normally the field payment_method should be filled with something coming from

PWA.

 

Therefore - if you are put in $order->info['payment_method'] instead of $payment_class->title in the checkout_process.php it should

showing the content of table orders -> payment_method there.

 

Please have a look in the database if there is any content written in by PWA in the field payment_method - if not, that may be the reason for

Share this post


Link to post
Share on other sites

I have a problem, the contribution works when a customer pays by check but it doesn't work when someone pays using paypal I have paypal ipn and my paypal pin url is checkout_success.php

 

Also I have tested it alot with paying by check and I can't seem to get the store logo to show up.

 

thnaks in advance

 

Chris

Share this post


Link to post
Share on other sites
I have a problem, the contribution works when a customer pays by check but it doesn't work when someone pays using paypal I have paypal ipn and my paypal pin url is checkout_success.php

 

Also I have tested it alot with paying by check and I can't seem to get the store logo to show up.

 

thnaks in advance

 

Chris

 

 

For the shop logo, you have to check the checkout_process.php in the /catalog/includes/languages/YOURLANGUAGEDIRECTORY

 

For the paypal issues i cant help you out because i´m not using that one. Which Version of the contribution do you use ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×