Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32
  1. #1
    Join Date
    Sep 2012
    Posts
    242
    Plugin Contributions
    0

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

  2. #2
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

    Default 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:
    Code:
           $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:
    Code:
          // 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.

  3. #3
    Join Date
    Sep 2012
    Posts
    242
    Plugin Contributions
    0

    Default 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!
    Last edited by southshorepizza; 20 Sep 2012 at 06:33 AM.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

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

  5. #5
    Join Date
    Sep 2012
    Posts
    242
    Plugin Contributions
    0

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

  6. #6
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

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

    Quote Originally Posted by southshorepizza View Post
    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.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

    Default 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:
    Code:
    zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") .
            EMAIL_THANKS_FOR_SHOPPING,
    becomes
    Code:
    zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") . "\n\n" .
            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.

  8. #8
    Join Date
    Sep 2012
    Posts
    242
    Plugin Contributions
    0

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

    Quote Originally Posted by DrByte View Post
    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

  9. #9
    Join Date
    Sep 2012
    Posts
    242
    Plugin Contributions
    0

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

    Quote Originally Posted by DrByte View Post
    To put a line break after the address, add it after the function that draws the address:
    Code:
    zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") .
            EMAIL_THANKS_FOR_SHOPPING,
    becomes
    Code:
    zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") . "\n\n" .
            EMAIL_THANKS_FOR_SHOPPING,
    Awesome!!! Thank you!

  10. #10
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

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

    Quote Originally Posted by southshorepizza View Post
    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:
    Code:
           $this->notify('NOTIFY_ORDER_INVOICE_CONTENT_FOR_ADDITIONAL_EMAILS',  array('zf_insert_id' => $zf_insert_id, 'text_email' =>  $email_order, 'html_email' => $html_msg));
    ... and that line is in a section that only fires for admin-specific emails, not for customer emails.
    .

    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.

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Replies: 29
    Last Post: 23 Jan 2014, 01:54 AM
  2. customizing order email, copy customer address + phone
    By fakeDecoy in forum General Questions
    Replies: 7
    Last Post: 20 Dec 2011, 09:16 PM
  3. Admin Email copy of order confirmation
    By Tech NO Babble in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 11 Aug 2010, 01:13 PM
  4. Email copy of customer order to second email address
    By WHOSYOURDADDY in forum Customization from the Admin
    Replies: 2
    Last Post: 13 Oct 2009, 03:31 AM
  5. Replies: 4
    Last Post: 9 Jun 2009, 08:17 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