Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Need to add "Comments:" before the comment section of Order Email

Need to add "Comments:" before the comment section of Order Email

26 Jul 2006, 4:01 PM
#1
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Post #1 by ksoup

I am sure it is simple, and I have overlooked it....I am trying to find the email template for orders so I can put "Comments:" in front of customer comments so that I can have a rule in my inbox that flags the Commented Orders.

Hope that makes sense.

Please advise. :)

27 Jul 2006, 7:39 AM
#2
drbyte avatar

drbyte

Sensei

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

Post #2 by drbyte

/includes/classes/order.php
around line 874 you have:php //comments area if ($this->info['comments']) { $email_order .= zen_db_output($this->info['comments']) . "\n\n"; $html_msg['ORDER_COMMENTS'] = zen_db_output($this->info['comments']); } else { $html_msg['ORDER_COMMENTS'] = ''; } replace with:```php
//comments area
if ($this->info['comments']) {
$email_order .= EMAIL_TEXT_ORDER_COMMENTS . ' ' . zen_db_output($this->info['comments']) . "\n\n";
$html_msg['ORDER_COMMENTS'] = EMAIL_TEXT_ORDER_COMMENTS . ' ' . zen_db_output($this->info['comments']);
} else {
$html_msg['ORDER_COMMENTS'] = '';
}


... and add a new define in your includes/languages/english/YOURTEMPLATE/checkout_process.php:
```php
define('EMAIL_TEXT_ORDER_COMMENTS', 'Customer Comments: ');

.
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.

7 Jan 2007, 3:44 PM
#3
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Post #3 by ksoup

Thank you. I applied this to our 1.3.6 install and it works like a charm! :)

7 Jul 2007, 5:08 AM
#4
brent2 avatar

brent2

New Zenner

Join Date:
Mar 2007
Location:
Seattle
Posts:
38
Plugin Contributions:
0

Post #4 by brent2

I have good email contact with my customers, and wish to delete the "comments" area during the ordering process. I don't think a customer has ever used it.

Can I ask exactly what files to edit?
And what those edits would be?

I thank the community in advance!
Brent

14 Dec 2008, 11:19 PM
#5
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Post #5 by ksoup

Dr. Byte... is this the same for 1.3.8?

The Order.php for 1.3.8 looks like...

    //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'] = '';
    }

DrByte:

/includes/classes/order.php
around line 874 you have:php //comments area if ($this->info['comments']) { $email_order .= zen_db_output($this->info['comments']) . "\n\n"; $html_msg['ORDER_COMMENTS'] = zen_db_output($this->info['comments']); } else { $html_msg['ORDER_COMMENTS'] = ''; } replace with:```php
//comments area
if ($this->info['comments']) {
$email_order .= EMAIL_TEXT_ORDER_COMMENTS . ' ' . zen_db_output($this->info['comments']) . "\n\n";
$html_msg['ORDER_COMMENTS'] = EMAIL_TEXT_ORDER_COMMENTS . ' ' . zen_db_output($this->info['comments']);
} else {
$html_msg['ORDER_COMMENTS'] = '';
}

> 
> ... and add a new define in your includes/languages/english/YOURTEMPLATE/checkout_process.php:
> ```php
define('EMAIL_TEXT_ORDER_COMMENTS', 'Customer Comments: ');
15 Dec 2008, 6:22 PM
#6
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Post #6 by ksoup

Tested with the following and it appears to work :)

[php] //comments area
if ($this->info['comments']) {
$email_order .= EMAIL_TEXT_ORDER_COMMENTS . ' ' . zen_db_output($this->info['comments']) . "\n\n";
$html_msg['ORDER_COMMENTS'] = EMAIL_TEXT_ORDER_COMMENTS . ' ' . nl2br(zen_db_output($this->info['comments']));
} else {
$html_msg['ORDER_COMMENTS'] = '';
}[/QUOTE]

15 Dec 2008, 7:13 PM
#7
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Post #7 by ksoup

Resubmitting so it looks clean :)

Tested with the following and it appears to work :)

     //comments area
    if ($this->info['comments']) {
      $email_order .= EMAIL_TEXT_ORDER_COMMENTS . ' ' . zen_db_output($this->info['comments']) . "\n\n";
      $html_msg['ORDER_COMMENTS'] = EMAIL_TEXT_ORDER_COMMENTS . ' ' . nl2br(zen_db_output($this->info['comments']));
    } else {
      $html_msg['ORDER_COMMENTS'] = '';
    }
21 Jan 2011, 3:52 PM
#8
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Post #8 by ksoup

Works in 1.3.9h, too! Thank you! Vital for us to keep up with any comments our customers are saying.

For those who are looking for this solution, we just have the "Customer Comments:" field show up in email and then have a filter or a rule that highlights any orders with comments on them so we can get to those comments quickly without looking through admin. :)

27 Mar 2011, 3:03 PM
#9
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Post #9 by ksoup

How I did it in 1.3.9 Clean Install of the cart...

(make a copy of your file to a safe place in the event you have any issues...)

I added the following code at about line 946 in the /includes/classes/order.php

ksoup:

 //comments area
if ($this->info['comments']) {
  $email_order .= EMAIL_TEXT_ORDER_COMMENTS . ' ' . zen_db_output($this->info['comments']) . "\n\n";
  $html_msg['ORDER_COMMENTS'] = EMAIL_TEXT_ORDER_COMMENTS . ' ' . nl2br(zen_db_output($this->info['comments']));
} else {
  $html_msg['ORDER_COMMENTS'] = '';
}