Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fax Number on orders.php


DisComChris

Recommended Posts

find this:

              <tr>
               <td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td>
               <td class="main"><?php echo $order->customer['telephone']; ?></td>
             </tr>

and add this below it:

              <tr>
               <td class="main"><b><?php echo ENTRY_FAX_NUMBER; ?></b></td>
               <td class="main"><?php echo $order->customer['fax']; ?></td>
             </tr>

 

-jared

Link to comment
Share on other sites

Ok. Got it. The orders table doesn't contain the fax number, just the telephone number. So, we've got to get it from the customers table and match it up via customers_id with the orders table.

 

Here's what we do (starting from scratch):

find

              <tr>
               <td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td>
               <td class="main"><?php echo $order->customer['telephone']; ?></td>
             </tr>

 

and add the following right afterwards:

              <tr>
              <td class="main"><b><?php echo ENTRY_FAX_NUMBER; ?></b></td>
              <td class="main">
               <?php 
                 $fax_query = tep_db_query("select customers_id, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = '" . $order->customer['id'] . "'" );
                 $fax_results = tep_db_fetch_array($fax_query);
                 echo $fax_results['customers_fax'];
               ?>               
              </td>
            </tr>

 

Then, in catalog/admin/includes/classes/orders.php, find the following:

    function query($order_id) {
     $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, 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, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

 

and change it to:

    function query($order_id) {
     $order_query = tep_db_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_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, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");

 

next, in the same orders class file, find

      $this->customer = array('name' => $order['customers_name'],
                             'company' => $order['customers_company'],
                             'street_address' => $order['customers_street_address'],
                             'suburb' => $order['customers_suburb'],
                             'city' => $order['customers_city'],
                             'postcode' => $order['customers_postcode'],
                             'state' => $order['customers_state'],
                             'country' => $order['customers_country'],
                             'format_id' => $order['customers_address_format_id'],
                             'telephone' => $order['customers_telephone'],
                             'email_address' => $order['customers_email_address']);

 

and change it to

      $this->customer = array('name' => $order['customers_name'],
                             'company' => $order['customers_company'],
                             'street_address' => $order['customers_street_address'],
                             'suburb' => $order['customers_suburb'],
                             'city' => $order['customers_city'],
                             'postcode' => $order['customers_postcode'],
                             'state' => $order['customers_state'],
                             'country' => $order['customers_country'],
                             'format_id' => $order['customers_address_format_id'],
                             'telephone' => $order['customers_telephone'],
                             'email_address' => $order['customers_email_address'],
                             'id' => $order['customers_id']);

 

We just added customers_id to the query in order to use it more easily in admin/orders.php, which will make our initial changes work.

 

There may be a better way to do this. This is how I made it work.

 

I can make it a contrib if'n you like it, and if'n it works for you.

 

-jared

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...