Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add FAX information to orders.php in admin?


DogFoodIT

Recommended Posts

Posted

Hi guys i have just started working with a new company and have been asked to make some changes to the OSC site. i need to add the fax field to show on the "admin/orders.php" page when viewing the orders.

 

i have noticed that the fax number field is not carried across to the order data table, so is it possible to make the changes to include the fax number on the order data or just call the number from the customers table. I'm not sure what would be the best way or how the code need to be altered. any help would be great. using osCommerce 2.2-MS2

 

thanks.

 

file i have been looking at:

admin/orders.php

admin/includes/classes/orders.php

  • 2 weeks later...
Posted

perfect thanks.

 

 

hi all,

 

i have run into a little issue with the add fax number code to orders.php

 

i have changed some of the code to show order id & order date.

 

 <!-- order number  & Date Purchased---->
             <?php
			$ord_query = tep_db_query("SELECT customers_id 
									   FROM " . TABLE_ORDERS . " 
									   WHERE orders_id = '" . (int)$oID . "'
									   ");

			while ($ord_id =  tep_db_fetch_array($ord_query)) {
				$ordid=$ord_id['orders_id'];
			}
			$ord_query = tep_db_query("SELECT *
									  FROM " . TABLE_ORDERS . " 
									  WHERE customers_id = '" . $custid . "'");

			while ($ord_num =  tep_db_fetch_array($ord_query)) {
			$ordnum=$ord_num['orders_id'];
			$orddate=$ord_num['date_purchased'];
			}

			?>
             <tr>
               <td class="main"><b><?php echo ENTRY_ORDER_NUMBER; ?></b></td>
               <td class="main"><?php echo $ordnum ?></td>
             </tr>
             <tr>
               <td class="main"><b><?php echo ENTRY_DATE_PURCHASED; ?></b></td>
               <td class="main"><?php echo $orddate ?></td>
             </tr>
             <!-- end order number  & Date Purchased ---->

 

for some reason it will only show the most current order number and the most current order date...

Now this is a issue if i need to look up a previous order.

 

i know this would be changed in the SQL Query but i'm just a little unsure on how to correct it.

 

thanking you kindly.

 

Ben

Posted

hi all,

 

i have run into a little issue with the add fax number code to orders.php

 

i have changed some of the code to show order id & order date.

 

 <!-- order number  & Date Purchased---->
             <?php
			$ord_query = tep_db_query("SELECT customers_id 
									   FROM " . TABLE_ORDERS . " 
									   WHERE orders_id = '" . (int)$oID . "'
									   ");

			while ($ord_id =  tep_db_fetch_array($ord_query)) {
				$ordid=$ord_id['orders_id'];
			}
			$ord_query = tep_db_query("SELECT *
									  FROM " . TABLE_ORDERS . " 
									  WHERE customers_id = '" . $custid . "'");

			while ($ord_num =  tep_db_fetch_array($ord_query)) {
			$ordnum=$ord_num['orders_id'];
			$orddate=$ord_num['date_purchased'];
			}

			?>
             <tr>
               <td class="main"><b><?php echo ENTRY_ORDER_NUMBER; ?></b></td>
               <td class="main"><?php echo $ordnum ?></td>
             </tr>
             <tr>
               <td class="main"><b><?php echo ENTRY_DATE_PURCHASED; ?></b></td>
               <td class="main"><?php echo $orddate ?></td>
             </tr>
             <!-- end order number  & Date Purchased ---->

 

for some reason it will only show the most current order number and the most current order date...

Now this is a issue if i need to look up a previous order.

 

i know this would be changed in the SQL Query but i'm just a little unsure on how to correct it.

 

thanking you kindly.

 

Ben

 

 

 

STOP looking lol

 

i have worked it out, i just used the classes info array to include the correct details....thanks anyways.

 

added `orders_id` to the query in the admin/includes/classes/orders.php

 

 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_id, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
     $order = tep_db_fetch_array($order_query);

 

and this

 

      $this->info = array('currency' => $order['currency'],
                         'currency_value' => $order['currency_value'],
                         'payment_method' => $order['payment_method'],
                         'cc_type' => $order['cc_type'],
                         'cc_owner' => $order['cc_owner'],
                         'cc_number' => $order['cc_number'],
                         'cc_expires' => $order['cc_expires'],
                         'date_purchased' => $order['date_purchased'],
added this*******-->>>>>  'order_id' => $order['orders_id'],

 

added the following to /orders.php

    <!-- order number  & Date Purchased---->
             <tr>
               <td class="main"><b><?php echo ENTRY_ORDER_NUMBER; ?></b></td>
               <td class="main"><?php echo $order->info['order_id']; //echo $ordnum ?></td>
             </tr>
             <tr>
               <td class="main"><b><?php echo ENTRY_DATE_PURCHASED; ?></b></td>
               <td class="main"><?php echo date('l jS  F  Y', strtotime($order->info['date_purchased']));// echo $orddate ?></td>
             </tr>
             <!-- end order number  & Date Purchased ---->

 

then define the language: /includes/LANGUAGE/orders.php

define('ENTRY_ORDER_NUMBER','Order #:');
define('ENTRY_DATE_PURCHASED','Order Date');

  • 1 year later...

Archived

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

×
×
  • Create New...