Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

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

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

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

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

    /includes/classes/order.php
    around line 874 you have:
    PHP Code:
        //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 Code:
        //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 Code:
    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.

  3. #3
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

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

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

  4. #4
    Join Date
    Mar 2007
    Location
    Seattle
    Posts
    38
    Plugin Contributions
    0

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

    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

  5. #5
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

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

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

    The Order.php for 1.3.8 looks like...
    PHP Code:
        //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'] = '';
        } 
    Quote Originally Posted by DrByte View Post
    /includes/classes/order.php
    around line 874 you have:
    PHP Code:
        //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 Code:
        //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 Code:
    define('EMAIL_TEXT_ORDER_COMMENTS''Customer Comments: '); 

  6. #6
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

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

    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]

  7. #7
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

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

    Resubmitting so it looks clean :)

    Tested with the following and it appears to work :)


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

  8. #8
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

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

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

  9. #9
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

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

    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

    Quote Originally Posted by ksoup View Post


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

 

 

Similar Threads

  1. v150 Remove "Office Use" section from Admin copy of Order Confirmation email
    By mkyle in forum Managing Customers and Orders
    Replies: 17
    Last Post: 19 May 2012, 11:05 PM
  2. Send shopping cart items before "confirm the order"
    By nonoobsnofun in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 19 Jan 2011, 01:01 PM
  3. Replies: 0
    Last Post: 26 Oct 2010, 10:51 PM
  4. Changing the "Special Instructions or Order Comments"
    By ckinsley in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 31 Dec 2009, 03:18 PM
  5. Need to add "work with us" section
    By makno in forum Addon Sideboxes
    Replies: 2
    Last Post: 7 Feb 2008, 01:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR