If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / Can I add extra customer address info to admin copy of order confirmation email?

Can I add extra customer address info to admin copy of order confirmation email?

Started by southshorepizza on 20 Sep 2012, 2:12 AM · Views: 4,294

Results 1 to 20 of 32
20 Sep 2012, 2:12 AM
#1
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Can I add extra customer address info to admin copy of order confirmation email?

I am completely lost on this one. But here is what I need to do on the admin email only.
I need to list the customer's telephone and delivery address between "Order Confirmation from business name" and "Thanks for shopping with us today" Currently it only displays the customer's name there. I need to get all three to display there.

If you could be specific on the code and location that would be wonderful. Javascript and php are not my strengths. I have learned a good deal but not near enough to get this done. Perhaps I am on the wrong form. Although I have tried it in 3 different areas. I am using the most currently available product as I just downloaded Zen-Cart on 9-12-12.
Thanks for your help.

20 Sep 2012, 3:41 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Can I add extra customer address info to admin copy of order confirmation email?

Assuming you're referring to text-only emails (not html-formatted emails):

/includes/classes/order.php
around line 1047 you'll see a line like this:

       $this->notify('NOTIFY_ORDER_INVOICE_CONTENT_FOR_ADDITIONAL_EMAILS',  array('zf_insert_id' => $zf_insert_id, 'text_email' =>  $email_order, 'html_email' => $html_msg));

Add this above it:```
// add customer address to top of admin confirmation email
if ($this->content_type != 'virtual') {
$email_order = str_replace(
// original text
EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
$this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
EMAIL_THANKS_FOR_SHOPPING ,
// replacement text
EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
$this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n" .
$this->customer['telephone']. "\n\n" .
zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") .
EMAIL_THANKS_FOR_SHOPPING,
// source of data being updated
$email_order);
}

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Sep 2012, 5:31 AM
#3
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Can I add extra customer address info to admin copy of order confirmation email?

Thank you very much. I had to change it a little bit for formatting. The way you suggested created emails that looked like this being sent to a customer and admin:

Order Confirmation from South Shore Pizza

First Last
PhoneXXXXX

First Last
Street Address
City, State Zip
United StatesThanks for shopping with us today!
The following are the details of your order.

I changed it to:

// replacement text
EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
$this->customer['telephone']. "\n\n" .
zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") .
EMAIL_THANKS_FOR_SHOPPING,
// source of data being updated
$email_order);

It now reads:

Order Confirmation.....

Phone

First Last
Address
City, State, Zip
United StatesThanks for shopping with us today!
The following are the details of your order.

So I got everything right up to "United StatesThanks for shopping with us today!"
How can I get a line break in between "United States" and "Thanks"?

Thank you so much for your help. I have literally spent 13 hours working on this and within 1.5 hours of posting on here I am almost done! This forum is great!

20 Sep 2012, 5:55 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Can I add extra customer address info to admin copy of order confirmation email?

"\n" = a line break. Note that those are double-quotes, not single.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Sep 2012, 5:16 PM
#5
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Can I add extra customer address info to admin copy of order confirmation email?

I think there is a line break there already. Could someone be specific as to where in the code to place it.

// add customer address to top of admin confirmation email
if ($this->content_type != 'virtual') {
$email_order = str_replace(
// original text
EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
$this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
EMAIL_THANKS_FOR_SHOPPING ,
// replacement text
EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
$this->customer['telephone']. "\n\n" .
zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") .
EMAIL_THANKS_FOR_SHOPPING,
// source of data being updated
$email_order);

Should I change the lines

zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") .
EMAIL_THANKS_FOR_SHOPPING,
// source of data being updated
$email_order);
to be a double line break at the end of this top line?
zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n**\n**") .
EMAIL_THANKS_FOR_SHOPPING,
// source of data being updated
$email_order);
Thanks again for the help.

20 Sep 2012, 5:54 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Can I add extra customer address info to admin copy of order confirmation email?

southshorepizza:

The way you suggested created emails that looked like this being sent to a customer and admin:
Um ... Did you REALLY find that this changed the CUSTOMER'S copy of the email? If so, then you implemented it in the wrong place.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Sep 2012, 5:56 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Can I add extra customer address info to admin copy of order confirmation email?

To put a line break after the address, add it after the function that draws the address:

zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") .
        EMAIL_THANKS_FOR_SHOPPING,
```becomes```
zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") . [B]"\n\n" .[/B]
        EMAIL_THANKS_FOR_SHOPPING,

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Sep 2012, 6:15 PM
#8
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Can I add extra customer address info to admin copy of order confirmation email?

DrByte:

Um ... Did you REALLY find that this changed the CUSTOMER'S copy of the email? If so, then you implemented it in the wrong place.
Yes. Both emails are identical except for the very bottom customer's copy doesn't have "Office Use Only" section
I put the change here
/includes/classes/order.php

20 Sep 2012, 6:15 PM
#9
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Can I add extra customer address info to admin copy of order confirmation email?

DrByte:

To put a line break after the address, add it after the function that draws the address:

zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") .
EMAIL_THANKS_FOR_SHOPPING,
becomes
zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") . [B]"\n\n" .[/B]
EMAIL_THANKS_FOR_SHOPPING,


Awesome!!!  Thank you!
20 Sep 2012, 6:41 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Can I add extra customer address info to admin copy of order confirmation email?

southshorepizza:

Yes. Both emails are identical except for the very bottom customer's copy doesn't have "Office Use Only" section
I put the change here
/includes/classes/order.php

But I told you to put it directly above this line:```
$this->notify('NOTIFY_ORDER_INVOICE_CONTENT_FOR_ADDITIONAL_EMAILS', array('zf_insert_id' => $zf_insert_id, 'text_email' => $email_order, 'html_email' => $html_msg));

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Sep 2012, 7:59 PM
#11
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Can I add extra customer address info to admin copy of order confirmation email?

I'm sorry. I missed the difference between the two lines. That is why I am not very good at this. I have moved it to the correct place. I am reading like crazy to try and learn as much of this as I can. It's just going to take some time.

Thank you very much for your help!!!!

14 Feb 2013, 7:27 PM
#12
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Can I add extra customer address info to admin copy of order confirmation email?

DrByte:

Assuming you're referring to text-only emails (not html-formatted emails):

/includes/classes/order.php
around line 1047 you'll see a line like this:

   $this->notify('NOTIFY_ORDER_INVOICE_CONTENT_FOR_ADDITIONAL_EMAILS',  array('zf_insert_id' => $zf_insert_id, 'text_email' =>  $email_order, 'html_email' => $html_msg));
> Add this above it:```
      // add customer address to top of admin confirmation email
      if ($this->content_type != 'virtual') {
        $email_order = str_replace(
        // original text
        EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
        $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
        EMAIL_THANKS_FOR_SHOPPING ,
        // replacement text
        EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
        $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n" .
        $this->customer['telephone']. "\n\n" .
        zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") .
        EMAIL_THANKS_FOR_SHOPPING,
        // source of data being updated
        $email_order);
      }

How could I add the order date and time to this as well.

So it would look like this

// replacement text
EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
ORDER DATE ORDER TIME
$this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n" .
$this->customer['telephone']. "\n\n" .
zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") .
EMAIL_THANKS_FOR_SHOPPING,
// source of data being updated

14 Feb 2013, 8:45 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Can I add extra customer address info to admin copy of order confirmation email?

The email is already date/time stamped with the date and time the order was placed, because the email is sent in the same minute.

But if you REALLY need to add that too, replace your "ORDER DATE ORDER TIME" line with:```
date('Y-m-d H:i') .

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 Feb 2013, 12:25 AM
#14
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Can I add extra customer address info to admin copy of order confirmation email?

I did not notice this thread was started as a text email thread. I am trying to place a date and time into the body of the html email. Basically what I want to happen is to get the telephone and time stamp out of the $extra_info box so I can delete that completely off the email. Every order is printing 2 pages because I get a bunch of info I do not need. We take orders over the phone into Zen-Cart so most orders have my ip address and my host address which causes the 2nd page to print.

Thank you.

15 Feb 2013, 12:51 AM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Can I add extra customer address info to admin copy of order confirmation email?

Reference: http://www.zen-cart.com/content.php?153-how-does-the-html-email-template-system-work

Add this to the other $html_msg vars in that section of the code:
$html_msg['ORDER_DATE'] = 'Order Time: ' . date('Y-m-d H:i');

Then add $ORDER_DATE into the email html template file wherever you want it to show.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 Feb 2013, 1:34 AM
#16
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Can I add extra customer address info to admin copy of order confirmation email?

Thank you so much!!! I have spent most of the day on this and was very close. That link you sent me will help out a great deal in the future!

21 Apr 2014, 8:53 PM
#17
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Can I add extra customer address info to admin copy of order confirmation email?

If I wanted to change more of the data being sent on the admin email I could take

 // add customer address to top of admin confirmation email
      if ($this->content_type != 'virtual') {
        $email_order = str_replace(
        // original text
        EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
        $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
        EMAIL_THANKS_FOR_SHOPPING ,
        // replacement text
        EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
        $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n" .
        $this->customer['telephone']. "\n\n" .
        zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") .
        EMAIL_THANKS_FOR_SHOPPING,
        // source of data being updated
        $email_order);
      }

then add more of the original code after the "// original text" but before the ","? I am assuming the string replace function the , is the key to what you are finding and what you are replacing. My question if that is how do ";" and "//" work in there? If they are in the original string do they have to be copied into the find section as well?

I'm asking here because I tried and did something wrong and had to restore backup. I'd rather not do that again.

Thank you for the lesson.

22 Apr 2014, 2:30 PM
#18
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Can I add extra customer address info to admin copy of order confirmation email?

That code for the "original" text comes from the PHP code in orders.php that assembles the original email.
So if you want to include more lines from that, go find that original code, copy it, and add it to your custom str-replace changes.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

22 Apr 2014, 4:47 PM
#19
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Can I add extra customer address info to admin copy of order confirmation email?

I am having issues adding to it.

the original code is:

$email_order = EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
      $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
      EMAIL_THANKS_FOR_SHOPPING . "\n" . EMAIL_DETAILS_FOLLOW . "\n" .
      EMAIL_SEPARATOR . "\n" .
      EMAIL_TEXT_ORDER_NUMBER . ' ' . $zf_insert_id . "\n\n" .
      EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_SHORT) . "\n\n";
      // FEC
      $email_order .= $invoiceInfo;
      // END FEC
      $html_msg['EMAIL_TEXT_HEADER']     = EMAIL_TEXT_HEADER;
      $html_msg['EMAIL_TEXT_FROM']       = EMAIL_TEXT_FROM;
      $html_msg['INTRO_STORE_NAME']      = STORE_NAME;
      $html_msg['EMAIL_THANKS_FOR_SHOPPING'] = EMAIL_THANKS_FOR_SHOPPING;
      $html_msg['EMAIL_DETAILS_FOLLOW']  = EMAIL_DETAILS_FOLLOW;
      $html_msg['INTRO_ORDER_NUM_TITLE'] = EMAIL_TEXT_ORDER_NUMBER;
      $html_msg['INTRO_ORDER_NUMBER']    = $zf_insert_id;
      $html_msg['INTRO_DATE_TITLE']      = EMAIL_TEXT_DATE_ORDERED;
      $html_msg['INTRO_DATE_ORDERED']    = strftime(DATE_FORMAT_SHORT);
      $html_msg['INTRO_URL_TEXT']        = EMAIL_TEXT_INVOICE_URL_CLICK;
      $html_msg['INTRO_URL_VALUE']       = zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false);

      //comments area
      if ($this->info['comments']) {
        $email_order .= zen_db_output($this->info['comments']) . "\n\n";
        $html_msg['ORDER_COMMENTS'] = nl2br(zen_db_output($this->info['comments']));
      } else {
        $html_msg['ORDER_COMMENTS'] = '';
      }
more code then
 //addresses area: Billing
      $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
      EMAIL_SEPARATOR . "\n" .
      zen_address_label($_SESSION['customer_id'], $_SESSION['billto'], 0, '', "\n") . "\n\n";
      $html_msg['ADDRESS_BILLING_TITLE']   = EMAIL_TEXT_BILLING_ADDRESS;
      $html_msg['ADDRESS_BILLING_DETAIL']  = zen_address_label($_SESSION['customer_id'], $_SESSION['billto'], true, '', "<br />");

To give an example of what I am attempting, I would like to delete and or replace the red sections. I was able to change the original code up until the first semicolon. After that anything I do breaks the confirmation page. How do I change beyond that first semicolon?

22 Apr 2014, 4:53 PM
#20
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Can I add extra customer address info to admin copy of order confirmation email?

I have tried it this way

if ($this->content_type != 'virtual') {
        $email_order = str_replace(
        // original text
        EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
      $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
      EMAIL_THANKS_FOR_SHOPPING . "\n" . EMAIL_DETAILS_FOLLOW . "\n" .
      EMAIL_SEPARATOR . "\n" .
      EMAIL_TEXT_ORDER_NUMBER . ' ' . $zf_insert_id . "\n\n" .
      EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_SHORT) . "\n\n" ,
        // replacement text
        EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
        $this->customer['telephone']. "\n\n" .
        zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") . "\n\n" .
        EMAIL_THANKS_FOR_SHOPPING,
       
        // source of data being updated
        $email_order);
     $email_order = str_replace(
        // original text
        $html_msg['INTRO_URL_TEXT']        = EMAIL_TEXT_INVOICE_URL_CLICK;
      $html_msg['INTRO_URL_VALUE']       = zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) ,
        // replacement text
        "" ,
       
        // source of data being updated
        $email_order);

      }

I have tried it this way

if ($this->content_type != 'virtual') {
        $email_order = str_replace(
        // original text
        EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
      $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
      EMAIL_THANKS_FOR_SHOPPING . "\n" . EMAIL_DETAILS_FOLLOW . "\n" .
      EMAIL_SEPARATOR . "\n" .
      EMAIL_TEXT_ORDER_NUMBER . ' ' . $zf_insert_id . "\n\n" .
      EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_SHORT) . "\n\n" ,
        // replacement text
        EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
        $this->customer['telephone']. "\n\n" .
        zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") . "\n\n" .
        EMAIL_THANKS_FOR_SHOPPING,
       
        // source of data being updated
        $email_order);
}
if ($this->content_type != 'virtual') {
     $email_order = str_replace(
        // original text
        $html_msg['INTRO_URL_TEXT']        = EMAIL_TEXT_INVOICE_URL_CLICK;
      $html_msg['INTRO_URL_VALUE']       = zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) ,
        // replacement text
        "" ,
       
        // source of data being updated
        $email_order);

      }

even this way + combinations of the 3.

[CODE]if ($this->content_type != 'virtual') {
        $email_order = str_replace(
        // original text
        EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
      $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
      EMAIL_THANKS_FOR_SHOPPING . "\n" . EMAIL_DETAILS_FOLLOW . "\n" .
      EMAIL_SEPARATOR . "\n" .
      EMAIL_TEXT_ORDER_NUMBER . ' ' . $zf_insert_id . "\n\n" .
      EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_SHORT) . "\n\n" ,
        // replacement text
        EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" .
        $this->customer['telephone']. "\n\n" .
        zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") . "\n\n" .
        EMAIL_THANKS_FOR_SHOPPING,
       
        // source of data being updated
        $email_order);
     $email_order = str_replace(
        // original text
        $html_msg['INTRO_URL_TEXT']        = EMAIL_TEXT_INVOICE_URL_CLICK;
      $html_msg['INTRO_URL_VALUE']       = zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) ,
        // replacement text
        STORE_NAME ,
       
        // source of data being updated
        $email_order);

      }