Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2017
    Location
    United Kingdom
    Posts
    4
    Plugin Contributions
    0

    Default Adding Fax/ Tel number to the orders list

    Looking at the orders page, as in the list of all your orders... it currently has the order numbers, customers names, company names, date of order etc.

    It is possible to display all the customers telephone / fax numbers in that list too?

    Reason being is I have changed the fax number field on sign up to a 'how did you hear about us' field, and I would like to see all these in the orders list, instead of manually having to click on each customer and go into their details to see the information.

    Many thanks

    David

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,695
    Plugin Contributions
    123

    Default Re: Adding Fax/ Tel number to the orders list

    In 1.5.6, look at admin/orders.php line 967. That's where the name is displayed in the list. Add the phone number after the display of company like this:

    . '<br>' . $orders->fields['customers_telephone'];

    so it looks like this:
    <td class="dataTableContent"><?php echo '<a href="' . zen_href_link(FILENAME_CUSTOMERS, 'cID=' . $orders->fields['customers_id'], 'NONSSL') . '">' . zen_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW . ' ' . TABLE_HEADING_CUSTOMERS) . '</a>&nbsp;' . $orders->fields['customers_name'] . ($orders->fields['customers_company'] != '' ? '<br>' . $orders->fields['customers_company'] : '') . '<br>' . $orders->fields['customers_telephone']; ?></td>

    Then on line 897, you'll see where $new_fields is defined. Add ", o.customers_telephone" to the list.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Apr 2017
    Location
    United Kingdom
    Posts
    4
    Plugin Contributions
    0

    Default Re: Adding Fax/ Tel number to the orders list

    Thats perfect, thanks very much, all works. Whats the field name for fax number?

  4. #4
    Join Date
    Apr 2017
    Location
    United Kingdom
    Posts
    4
    Plugin Contributions
    0

    Default Re: Adding Fax/ Tel number to the orders list

    Quote Originally Posted by swguy View Post
    In 1.5.6, look at admin/orders.php line 967. That's where the name is displayed in the list. Add the phone number after the display of company like this:

    . '<br>' . $orders->fields['customers_telephone'];

    so it looks like this:
    <td class="dataTableContent"><?php echo '<a href="' . zen_href_link(FILENAME_CUSTOMERS, 'cID=' . $orders->fields['customers_id'], 'NONSSL') . '">' . zen_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW . ' ' . TABLE_HEADING_CUSTOMERS) . '</a>##' . $orders->fields['customers_name'] . ($orders->fields['customers_company'] != '' ? '<br>' . $orders->fields['customers_company'] : '') . '<br>' . $orders->fields['customers_telephone']; ?></td>

    Then on line 897, you'll see where $new_fields is defined. Add ", o.customers_telephone" to the list.
    Ive just tried customers_fax too but I then get this error...

    1054 Unknown column 'o.customers_fax' in 'field list'
    in:
    [select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, o.customers_company, o.customers_email_address, o.customers_street_address, o.delivery_company, o.delivery_name, o.delivery_street_address, o.billing_company, o.billing_name, o.billing_street_address, o.payment_module_code, o.shipping_module_code, o.ip_address, o.customers_fax from (orders o ) left join orders_status s on (o.orders_status = s.orders_status_id and s.language_id = 1) left join orders_total ot on (o.orders_id = ot.orders_id and ot.class = 'ot_total') order by o.orders_id DESC limit 0, 500]

    Is this because no one has yet filled a fax number in when they signed up? I only just turned this on..

  5. #5
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: Adding Fax/ Tel number to the orders list

    customers_fax is not stored in the orders table so you won't be able to look it up from there. It's only stored in the customers table. There's 2 things you could do:
    - look it up from the customers table - can be inaccurate in case the customer changes it after placing the order
    - modify the orders table and add customers_fax field, and then modify the includes/classes/order.php to make sure customers_fax is being stored in the orders table when the order is placed. This way you always get the data that was relevant at the time of purchase.

    P.S. option #2 can be done using observers so you don't need to modify core files

  6. #6
    Join Date
    Apr 2017
    Location
    United Kingdom
    Posts
    4
    Plugin Contributions
    0

    Default Re: Adding Fax/ Tel number to the orders list

    Quote Originally Posted by balihr View Post
    customers_fax is not stored in the orders table so you won't be able to look it up from there. It's only stored in the customers table. There's 2 things you could do:
    - look it up from the customers table - can be inaccurate in case the customer changes it after placing the order
    - modify the orders table and add customers_fax field, and then modify the includes/classes/order.php to make sure customers_fax is being stored in the orders table when the order is placed. This way you always get the data that was relevant at the time of purchase.

    P.S. option #2 can be done using observers so you don't need to modify core files

    Viewing it from the customers table would be absolutely fine.

    Do you know what code adjustments would be required?

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,695
    Plugin Contributions
    123

    Default Re: Adding Fax/ Tel number to the orders list

    If you were going to use an observer, you could get the customer's phone number there too. Use NOTIFY_ADMIN_ORDERS_LIST_EXTRA_COLUMN_DATA.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. Adding customer fax number to admin order display
    By cjsmiff in forum Customization from the Admin
    Replies: 0
    Last Post: 5 Mar 2010, 02:31 AM
  2. Adding client Fax number to confirmation email
    By JuanDBB in forum General Questions
    Replies: 2
    Last Post: 5 May 2009, 03:35 PM
  3. Adding Fax Number Field to Packing/Invoice
    By esugrue in forum Managing Customers and Orders
    Replies: 11
    Last Post: 6 Mar 2009, 05:38 PM
  4. Quick method for adding manual (mail & fax) orders
    By rbobzin in forum General Questions
    Replies: 1
    Last Post: 17 Jan 2008, 12:46 PM
  5. Can I change the Customer Fax Number
    By gardengate in forum Customization from the Admin
    Replies: 3
    Last Post: 11 Oct 2006, 09:24 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