Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Jun 2005
    Location
    Texas
    Posts
    59
    Plugin Contributions
    0

    Default Adding Information to "Office Use Only" Email Footer

    I attempted this a few months ago without success. Here was my original post on the subject:

    http://zen-cart.com/forum/showthread.php?t=26953

    Now I'm trying again. I'm trying to call up information from the addres book table to add to the office use only footer of the email. I was able to create a query without messing up functions_email.php. I put it right above the big marker that says, end of email functions. Here it is:


    //Get customer's city info

    $customers_city = $db->Execute("select entry_city from " . TABLE_ADDRESS_BOOK . " where customers_id= '" . $customers_id . "'");
    $city = $customers_city->fields['entry_city'];


    Then in the office use only section at the bottom of the file I created a city variable below the others like it (I also named the variable in the language file):


    OFFICE_USE . "\t" . "\n" .
    OFFICE_FROM . "\t" . $from . "\n" .
    OFFICE_EMAIL. "\t" . $email_from . "\n" .
    OFFICE_CITY. "\t" . $city . "\n" .


    And then called that variable like this:



    '<tr><td class="extra-info-bold">' . OFFICE_EMAIL. '</td><td>' . $email_from . '</td></tr>' .
    '<tr><td class="extra-info-bold">' . OFFICE_CITY. '</td><td>' . $city . '</td></tr>' .


    I know the code isn't bad because I can create an account, and everything parses correctly, and I see the word "City" for OFFICE_CITY, but where the $city is in the table, nothing appears.

    Any ideas?

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Adding Information to "Office Use Only" Email Footer

    $customers_id

    Are you sure you want to use $customers_id and not $_SESSION['customer_id']
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Adding Information to "Office Use Only" Email Footer

    NOTE: you also want to check ... on the TEXT you do not want those tables ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Jun 2005
    Location
    Texas
    Posts
    59
    Plugin Contributions
    0

    Default Re: Adding Information to "Office Use Only" Email Footer

    Linda,

    You're right, tables are bad. I'm the processing of going to the XHTML version.

    $_SESSION['customer_id'] is definitely a better idea. I swapped that in the code but it's still not parsing. Any other ideas? Something I coded wrong?

    Thanks for your help. Hopefully this is something that others can benefit from too. Or maybe I'm the only zenner in history who wants MORE office use only.

    Len

  5. #5
    Join Date
    Jun 2005
    Location
    Texas
    Posts
    59
    Plugin Contributions
    0

    Default Re: Adding Information to "Office Use Only" Email Footer

    I made a few other minor changes but it's still not getting the info from the db, as far as I can tell. Here is what I have so far:

    1) This is above the end of functions marker

    //Get customer extra info
    $customers_info = $db->Execute("select entry_city,entry_state,entry_comments from " . TABLE_ADDRESS_BOOK . " where customers_id= '" . $_SESSION['customer_id'] . "'");
    $city = $customers_info->fields['entry_city'];
    $state = $customers_info->fields['entry_state'];
    $comments = $customers_info->fields['entry_comments'];

    2) This is the existing footer section, modified:

    // generate footer details for "also-send-to" emails
    $extra_info=array();
    $extra_info['TEXT'] =
    OFFICE_USE . "\t" . "\n" .
    OFFICE_FROM . "\t" . $from . "\n" .
    OFFICE_EMAIL. "\t" . $email_from . "\n" .
    OFFICE_CITY. "\t" . $city . "\n" .
    OFFICE_STATE. "\t" . $state . "\n" .
    OFFICE_COMMENTS. "\t" . $comments . "\n" .

    3) This is the email (pardon the old tables):

    '<tr><td class="extra-info-bold">' . OFFICE_CITY. '</td><td>' . $city . '</td></tr>' .
    '<tr><td class="extra-info-bold">' . OFFICE_STATE. '</td><td>' . $state . '</td></tr>' .
    '<tr><td class="extra-info-bold">' . OFFICE_COMMENTS. '</td><td>' . $comments . '<br /><br /></td></tr>' .


    Seems like it should make sense but obviously something is missing. Help?

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Adding Information to "Office Use Only" Email Footer

    Couple of things ...

    At the start of the function ... you are most likely missing:
    global $db;

    But the error may be being suppressed so you are not seeing it ...

    Next, the TABLE_ADDRESS_BOOK contains 1 to many addresses for a customer ...

    Their current Address information is based on the customers table field:
    customers_default_address_id

    This is the Primary Address that the customer has setup in the address_book table ...

    If you just grab the record from the address_book based on the customers id ... then you are getting the "first" one found which may or may not be the actual Primary Address information ...

    Before worrying about "which" of the 1 to many address_book records you get for a customer ... first get this working ...

    Adding the line:
    global $db;

    As the first line of the:
    function email_collect_extra_info

    Should help get you back on track ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Jun 2005
    Location
    Texas
    Posts
    59
    Plugin Contributions
    0

    Default Re: Adding Information to "Office Use Only" Email Footer

    Okay, I added:

    global $db

    and got nothing. Then I wrapped the code in a function like this:

    function email_collect_extra_info {

    global $db
    $customers_info = $db->Execute("select entry_city,entry_state,entry_comments from " . TABLE_ADDRESS_BOOK . " where customers_id= '" . $_SESSION['customer_id'] . "'");
    $city = $customers_info->fields['entry_city'];
    $state = $customers_info->fields['entry_state'];
    $comments = $customers_info->fields['entry_comments'];

    }

    When I uploaded this the function_email.php page got hung up totally which made my store index blank. So that obviously was not a good solution.

    Sorry for being so ignorant on this. I'm self taught so there's certain advanced things I know and certainbasics I don't. Thanks for your help.

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Adding Information to "Office Use Only" Email Footer

    global $db;
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  9. #9
    Join Date
    Jun 2005
    Location
    Texas
    Posts
    59
    Plugin Contributions
    0

    Default Re: Adding Information to "Office Use Only" Email Footer

    oops. I actually had this in the code but didn't write it in the post.

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Adding Information to "Office Use Only" Email Footer

    Do you have a new field entry_comments in your address_book

    That is not standard with Zen Cart ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 
Page 1 of 2 12 LastLast

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. Replies: 8
    Last Post: 18 Nov 2008, 03:28 AM
  3. office use only doesnt send "phone number"
    By censon in forum General Questions
    Replies: 3
    Last Post: 10 Sep 2007, 08:18 PM
  4. Replies: 7
    Last Post: 26 Aug 2007, 07:08 AM

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