Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Feb 2008
    Location
    Philadelphia
    Posts
    290
    Plugin Contributions
    3

    Default Add to office use only in confirm email to admin

    I have been monkeying with this area and it's just not posting into the email so I am clearly doing something wrong.

    To update/increase the office use only section of the email I altered 2 files

    1) email_extras to add a define
    2) functions_email to add the line into the email

    But nothing shows in the confirm email. I do not want the line going to clients that order.

    Here is the code in (I think) the relevant section

    function email_collect_extra_info($from, $email_from, $login, $login_email, $login_phone='', $login_fax='', $login_customers_extrafield5='') {
    // get host_address from either session or one time for both email types to save server load
    if (!$_SESSION['customers_host_address']) {
    if (SESSION_IP_TO_HOST_ADDRESS == 'true') {
    $email_host_address = @gethostbyaddr($_SERVER['REMOTE_ADDR']);
    } else {
    $email_host_address = OFFICE_IP_TO_HOST_ADDRESS;
    }
    } else {
    $email_host_address = $_SESSION['customers_host_address'];
    }

    // 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" .
    (trim($login) !='' ? OFFICE_LOGIN_NAME . "\t" . $login . "\n" : '') .
    (trim($login_email) !='' ? OFFICE_LOGIN_EMAIL . "\t" . $login_email . "\n" : '') .
    ($login_phone !='' ? OFFICE_LOGIN_PHONE . "\t" . $login_phone . "\n" : '') .
    ($login_fax !='' ? OFFICE_LOGIN_FAX . "\t" . $login_fax . "\n" : '') .
    ($login_customers_extrafield5 !='' ? OFFICE_FIELD5 . "\t" . $login_customers_extrafield5 . "\n" : '') .
    OFFICE_IP_ADDRESS . "\t" . $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] . "\n" .
    OFFICE_HOST_ADDRESS . "\t" . $email_host_address . "\n" .
    OFFICE_DATE_TIME . "\t" . date("D M j Y G:i:s T") . "\n\n";

    Needless to say the thing I am attempting to add is one of the extrafields from the related plugin whose data lies in customer so in same table as some of the other pulls.

    Is there another thing I am missing? Probably

  2. #2
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Add to office use only in confirm email to admin

    Be sure to add your new field to this file:
    includes/classes/order.php
    As it will compile the data for the checkout to send the email.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  3. #3
    Join Date
    Feb 2008
    Location
    Philadelphia
    Posts
    290
    Plugin Contributions
    3

    Default Re: Add to office use only in confirm email to admin

    Unfortunately still not solved. I added this stuff lines 43 ish orders.php

    $order_query = "select customers_id, customers_name, customers_company,
    customers_street_address, customers_suburb, customers_city,
    customers_postcode, customers_state, customers_country,
    customers_telephone, customers_email_address, customers_extrafield5, customers_address_format_id,
    delivery_name, delivery_company, delivery_street_address, delivery_suburb,
    delivery_city, delivery_postcode, delivery_state, delivery_country,
    delivery_address_format_id, billing_name, billing_company,
    billing_street_address, billing_suburb, billing_city, billing_postcode,
    billing_state, billing_country, billing_address_format_id,
    payment_method, payment_module_code, shipping_method, shipping_module_code,
    coupon_code, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value,
    date_purchased, orders_status, last_modified, order_total, order_tax, ip_address
    from " . TABLE_ORDERS . "
    where orders_id = '" . (int)$order_id . "'";

    then at bottom in additional details I added this

    // send additional emails
    if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
    $extra_info=email_collect_extra_info('','', $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], $this->customer['telephone'], $this->customer['customers_extrafield5']);
    $html_msg['EXTRA_INFO'] = $extra_info['HTML'];

    this is added to the original code. Nothing posts to the office use yet...

  4. #4
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Add to office use only in confirm email to admin

    includes/classes/order.php
    Add your new field to all of the sql customer data fields:

    'customers_extrafield5' => $this->customer['extrafield5'],
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  5. #5
    Join Date
    Feb 2008
    Location
    Philadelphia
    Posts
    290
    Plugin Contributions
    3

    Default Re: Add to office use only in confirm email to admin

    I am having no luck on this. I see no customer table calls of note so I added a customers query from another thread on same topic which I followed to letter and got noplace which is why I am still at this.

    In orders.php most files are coming from orders or address book neither of which contain the extrafield data as it's in customers.

    So I added on line 940
    //extra fields addition
    global $db;
    $extra_query ="select customers_extrafield, customers_extrafield2, customers_extrafield3, customers_extrafield4, customers_extrafield5 from ".TABLE_CUSTOMERS." WHERE customers_id = '".$_SESSION['customer_id'] ."'";
    $extra_field = $db->Execute($extra_query);
    $extra_field->fields['customers_id'];

    no errors are thrown and orders process fine but the data does not appear on the email. I tried putting it in top portion of email below the customers name to keep it simple and no joy.

    Can you point me a bit closer?

  6. #6
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Add to office use only in confirm email to admin

    I almost need to see your site/code at this point.

    If the data is being passed to the database inside the new field, then you should be able to see it when it's called for.

    Is there data being recorded in the db?
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

 

 

Similar Threads

  1. Need Welcome email to contain Office Use Only information
    By mcarbone in forum General Questions
    Replies: 5
    Last Post: 4 Sep 2009, 12:40 AM
  2. Email - Office Use Only on order emails
    By NickSMM in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 19 Feb 2008, 01:35 AM
  3. What happened to Office Use Only portion of Email
    By Bostitch in forum General Questions
    Replies: 1
    Last Post: 4 Jul 2007, 05:12 AM

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