Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

customer_fax field in admin/orders.php


mcfcben

Recommended Posts

Posted

Hi,

 

I'm currently stuck on a bit of a problem.

 

Basically, when a user creates/sign's up to our website they are given an option to give a telephone number, and a 'fax' number (which lets say, for simplicities sake, will be the field assigned to where I want the 'additional/mobile' number to input data into).

 

Using phpMyAdmin I can confirm that the data is going to customers_fax in the Customers table fine, and being stored, so no issues there.

 

On the admin/orders.php file, I would like the additional number/fax number to be shown underneath the 'telephone field like so:

 

2i11klz.jpg

 

As you can see, I have everything in place, and its showing up blank.

 

Now, I know that the actual code used has to transfer the customers_fax entry in the customers table to the customers_fax entry in the orders table (there are no issues with the orders table as I have used phpMyAdmin to manually create a field called customers_fax)

 

Yet, frustratingly, everything I try I am unable to get this information to appear in the orders table in order to be called into the location. Sample code I have tried include a left join of the two tables, like in the code provided below and bolded:

 

<?php
/* google checkout start */
   if (isset($HTTP_GET_VARS['cID'])) {
     $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
     $orders_query_raw = "select c.customers_fax, o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.google_order_number, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE CUSTOMERS . " c on (o.customers_id = c.customers_id) , " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
   } elseif (isset($HTTP_GET_VARS['status']) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0)) {
     $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
     $orders_query_raw = "select c.customers_fax, o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.google_order_number, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE CUSTOMERS . " c on (o.customers_id = c.customers_id) , " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' " . (!is_null($search_query)?$search_query:''). "order by o.orders_id DESC";
   } else {
     $orders_query_raw = "select c.customers_fax, o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.google_order_number, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE CUSTOMERS . " c on (o.customers_id = c.customers_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' " . (!is_null($search_query)?$search_query:''). "order by o.orders_id DESC";
   }

 

I got this code snippet from this thread

http://www.oscommerce.com/forums/topic/334852-how-to-show-customer-phone-number-in-the-administration-orders-page/page__p__1411972__hl__add%20fax%20to%20orders__fromsearch__1entry1411972

 

 

Could anyone help me and see why the data is refusing to transfer from the customers table to the orders table?

 

Many thanks in advance

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...