Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2006
    Posts
    43
    Plugin Contributions
    0

    red flag Guide to show Fax # on Order page?

    The first step of edit alway BACKUP data and the files you need to edit.

    After backup database login to you Zen-cart Admin page

    Tools-> Install SQL Patches
    paste the SQL Command above and press Send

    Code:
    ALTER TABLE orders ADD customers_fax varchar(32) NOT NULL default '';
    Open Yourzencartroot/admin/orders.php

    Search: (around Line 294)
    Code:
     
                 <tr>
                    <td class="main"><strong><?php echo ENTRY_TELEPHONE_NUMBER; ?></strong></td>
                    <td class="main"><?php echo $order->customer['telephone']; ?></td>
                  </tr>
    Replace:
    Code:
                  <tr>
                    <td class="main"><strong><?php echo ENTRY_TELEPHONE_NUMBER; ?></strong></td>
                    <td class="main"><?php echo $order->customer['telephone']; ?></td>
                  </tr>
                  <tr>
                    <td class="main"><strong><?php echo ENTRY_FAX_NUMBER; ?></strong></td>
                    <td class="main"><?php echo $order->customer['fax']; ?></td>
                  </tr>
    Search: (around Line 615)
    Code:
    o.customers_telephone like '%" . $keywords . "%'
    Replace:
    Code:
    o.customers_telephone like '%" . $keywords . "%' or o.customers_fax like '%" . $keywords . "%'
    Save and Close

    Open Yourzencartroot/admin/includes/classes/order.php

    Search: (around Line 40)
    Code:
    customers_state, customers_country, customers_telephone,
    Replace:
    Code:
    customers_state, customers_country, customers_telephone, customers_fax,
    Search: (around Line 97)
    Code:
    'telephone' => $order->fields['customers_telephone'],
    Replace:
    Code:
    'telephone' => $order->fields['customers_telephone'],
    'fax' => $order->fields['customers_fax'],
    Save and Close

    Open Yourzencartroot/includes/classes/order.php

    Search: (around Line 46)
    Code:
    customers_telephone,
    Replace:
    Code:
    customers_telephone, customers_fax,
    Search: (around Line 127)
    Code:
    'telephone' => $order->fields['customers_telephone'],
    Replace:
    Code:
    'telephone' => $order->fields['customers_telephone'],
    'fax' => $order->fields['customers_fax'],
    Search: (around Line 232)
    Code:
    c.customers_telephone,
    Replace:
    Code:
    c.customers_telephone, c.customers_fax,
    Search: (around Line 384 )
    Code:
    'telephone' => $customer_address->fields['customers_telephone'],
    Replace:
    Code:
    'telephone' => $customer_address->fields['customers_telephone'],
    'fax' => $customer_address->fields['customers_fax'],
    Search: (around Line 575)
    Code:
    'customers_telephone' => $this->customer['telephone'],
    Replace:
    Code:
    'customers_telephone' => $this->customer['telephone'],
    'customers_fax' => $this->customer['fax'],
    Search: (around Line 985)
    Code:
    $this->customer['telephone']
    Replace:
    Code:
    $this->customer['telephone'], $this->customer['fax']
    Save and Close

    OK It should work now

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,726
    Plugin Contributions
    6

    Default Re: Guide to show Fax # on Order page

    Thanks for breaking this down for others who need to add the Fax or perhaps another field to their orders ...
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3
    Join Date
    Dec 2006
    Posts
    79
    Plugin Contributions
    0

    Default Re: Guide to show Fax # on Order page

    Thank you for this amazingly easy to follow contribution.

    One quick Question though. I did this and everything works. When new orders are placed it inserts the fax number into the customers_fax database field under orders.

    Now is there a way to get all the old orders' fax number into this field?

    I'm sure there has to be some SQL Command to do this...

    Thank you in advance.

  4. #4
    Join Date
    Dec 2006
    Posts
    79
    Plugin Contributions
    0

    Default Re: Guide to show Fax # on Order page

    Can someone please reply to this? I need to know if we have to actually do this manually.

    Thanks...

  5. #5
    Join Date
    Mar 2008
    Posts
    48
    Plugin Contributions
    0

    Default Re: Guide to show Fax # on Order page

    Just wanted to let everyone know I had to edit page:

    /includes/modules/checkout_process.php

    FIND:

    customers_telephone' => $order->customer['telephone'],


    ADD:

    customers_telephone' => $order->customer['telephone'], customers_fax' => $order->customer['fax'],

  6. #6
    Join Date
    Jul 2011
    Posts
    116
    Plugin Contributions
    0

    Default Re: Guide to show Fax # on Order page

    While I go back and triple check, does anybody have ideas on where I should look for the potential problem. Here' the info:

    I know this is an extremely old post but because it looked like a simple fix I was hoping it would work for zc1.3.9h which is what I'm using. Any reason it shouldn't

    -Issue is if I populate my cart, click "go to checkout", I get an internal server error 500.
    -I double checked all the code in my files to that posted in #1 and it matches.
    -I looked in the admin>customers>orders and if I open up an order I can see the heading for the new field I added
    -I went into the database and populated one of my older test orders and then refreshed the admin>customers>orders and the heading still shows but not the data for that field.
    -I did not do the coding listed by DrbyDay because I did not see that line of code in the file listed.
    ZC 1.3.9h
    Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

  7. #7
    Join Date
    Jul 2011
    Posts
    116
    Plugin Contributions
    0

    Default Re: Guide to show Fax # on Order page

    OK I keep forgetting about using the cache log to help identify the problems, but here is the error I've gotten:

    [02-Sep-2011 08:42:09] PHP Parse error: syntax error, unexpected ',' in /includes/classes/order.php on line 1028


    Line 1027-
    // $extra_info=email_collect_extra_info('','', $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], $this->customer['telephone']);

    Line 1028-
    $extra_info=email_collect_extra_info('','', $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], $this->customer['telephone']), $this->customer['dac_code']);

    If I //Line1028 and un// line 1027 it seems to let me through to the next page. I've changed the last ; to a , as well as omitting it altogether. The addition of , $this->customer['dac_code']); seems to break it.

    Any thoughts out there?
    ZC 1.3.9h
    Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

  8. #8
    Join Date
    Jul 2011
    Posts
    116
    Plugin Contributions
    0

    Default Re: Guide to show Fax # on Order page

    Quote Originally Posted by idc1 View Post
    Line 1028-
    $extra_info=email_collect_extra_info('','', $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], $this->customer['telephone']), $this->customer['dac_code']);
    I had an extra )
    ZC 1.3.9h
    Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,726
    Plugin Contributions
    6

    Default Re: Guide to show Fax # on Order page

    Thanks for the update and for posting the solution ...
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  10. #10
    Join Date
    Jul 2011
    Posts
    116
    Plugin Contributions
    0

    Default Re: Guide to show Fax # on Order page?

    I got the extra field 'dac_code' to show up in the order that is sent to the admin. The problem is that it shows as:

    Office Use Only:
    From:
    Email:
    Login Name: correct info
    Login Email: correct info
    Telephone: correct info
    Fax: AB1234
    IP Address: correct info
    Host Address: correct info
    Date and Time: correct info

    instead of

    Office Use Only:
    From:
    Email:
    Login Name: correct info
    Login Email: correct info
    Telephone: correct info
    DAC Code: AB1234
    IP Address: correct info
    Host Address: correct info
    Date and Time: correct info


    I traced back the fax logic and made the following changes.

    includes/functions/functions_email.php

    /**
    * Function to build array of additional email content collected and sent on admin-copies of emails:
    *
    */
    function email_collect_extra_info($from, $email_from, $login, $login_email, $login_phone='', $login_fax='', $login_dac_code='') {
    // 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_dac_code !='' ? OFFICE_LOGIN_DAC_CODE . "\t" . $login_dac_code . "\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";

    $extra_info['HTML'] = '<table class="extra-info">' .
    '<tr><td class="extra-info-bold" colspan="2">' . OFFICE_USE . '</td></tr>' .
    '<tr><td class="extra-info-bold">' . OFFICE_FROM . '</td><td>' . $from . '</td></tr>' .
    '<tr><td class="extra-info-bold">' . OFFICE_EMAIL. '</td><td>' . $email_from . '</td></tr>' .
    ($login !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_NAME . '</td><td>' . $login . '</td></tr>' : '') .
    ($login_email !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_EMAIL . '</td><td>' . $login_email . '</td></tr>' : '') .
    ($login_phone !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_PHONE . '</td><td>' . $login_phone . '</td></tr>' : '') .
    ($login_fax !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_FAX . '</td><td>' . $login_fax . '</td></tr>' : '') .
    ($login_dac_code !='' ? '<tr><td class="extra-info-bold">' . OFFICE_LOGIN_DAC_CODE . '</td><td>' . $login_dac_code . '</td></tr>' : '') .
    '<tr><td class="extra-info-bold">' . OFFICE_IP_ADDRESS . '</td><td>' . $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] . '</td></tr>' .
    '<tr><td class="extra-info-bold">' . OFFICE_HOST_ADDRESS . '</td><td>' . $email_host_address . '</td></tr>' .
    '<tr><td class="extra-info-bold">' . OFFICE_DATE_TIME . '</td><td>' . date('D M j Y G:i:s T') . '</td></tr>' . '</table>';
    return $extra_info;
    }

    includes/language/english/YOUR_TEMPLATE/email_extras.php

    define('OFFICE_USE','<strong>Office Use Only:</strong>');
    define('OFFICE_LOGIN_NAME','<strong>Login Name:</strong>');
    define('OFFICE_LOGIN_EMAIL','<strong>Login Email:</strong>');
    define('OFFICE_LOGIN_PHONE','<strong>Telephone:</strong>');
    define('OFFICE_LOGIN_FAX','<strong>Fax:</strong>');
    define('OFFICE_LOGIN_DAC_CODE','<strong>DAC Code:</strong>');
    define('OFFICE_IP_ADDRESS','<strong>IP Address:</strong>');
    define('OFFICE_HOST_ADDRESS','<strong>Host Address:</strong>');
    define('OFFICE_DATE_TIME','<strong>Date and Time:</strong>');

    Any idea where I went wrong? I'm using ZC1.3.9h
    ZC 1.3.9h
    Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

 

 

Similar Threads

  1. Model # does not show up in Order Page
    By ttmb33 in forum Managing Customers and Orders
    Replies: 1
    Last Post: 1 Sep 2011, 11:16 PM
  2. Show description on admin>>order page
    By gaurav10feb in forum General Questions
    Replies: 1
    Last Post: 9 Dec 2010, 06:53 AM
  3. Show country on order page
    By gilby in forum Managing Customers and Orders
    Replies: 1
    Last Post: 8 Dec 2008, 02:59 AM
  4. Comments dont show up on order page
    By puppet87112 in forum General Questions
    Replies: 0
    Last Post: 11 Jan 2007, 07:45 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
  •