We use cookies to improve our services and provide a better experience. By continuing to use this site, you agree with our Cookies Policy.

Tutorials
More than 400 step-by-step articles to guide you through online project development.
HomeTutorialsCMS TutorialsosCommerceosCommerce Administration

How to add fax number to admin/orders.php

Ubuntu VPS
Linux Cloud Server
Linux KVM Hosting
cPanel KVM
Brazil VPS
Windows Cloud Server
KVM VPS
Germany Cloud Servers
OpenVZ VPS
USA VPS

If you want to include fax number to the orders page in the admin backend, there are some modifications you might need to do with the osCommerce installation. Generally, a fax number is not being added to the orders page, therefore, it needs to be added manually by editing file located at “admin/includes/classes/order.php”.

Follow these steps to add a fax number

Start by editing “admin/includes/classes/order.php”. This can be done by connecting to an FTP client or by using a built in file manager. Then locate the following code entry:

1
2
3
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 . "'");
$order = tep_db_fetch_array($order_query);

Replace it with the following line.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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, <strong>customers_fax</strong>, 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 . "'");
$order = tep_db_fetch_array($order_query);</code>
 
	<p style="text-align: justify;">As noticed, we are replacing this code entry by adding "<strong>customers_fax</strong>" option which is bolded.  After doing this modification, find another code entry that looks as follows.</p>
 
<code>$this-&gt;customer = array('name' =&gt; $order['customers_name'],
'company' =&gt; $order['customers_company'],
'street_address' =&gt; $order['customers_street_address'],
'suburb' =&gt; $order['customers_suburb'],
'city' =&gt; $order['customers_city'],
'postcode' =&gt; $order['customers_postcode'],
'state' =&gt; $order['customers_state'],
'country' =&gt; $order['customers_country'],
'format_id' =&gt; $order['customers_address_format_id'],
'telephone' =&gt; $order['customers_telephone'],
'email_address' =&gt; $order['customers_email_address']);

Replace it with the following code entry.

1
2
3
4
5
6
7
8
9
10
11
12
$this-&gt;customer = array('name' =&gt; $order['customers_name'],
'company' =&gt; $order['customers_company'],
'street_address' =&gt; $order['customers_street_address'],
'suburb' =&gt; $order['customers_suburb'],
'city' =&gt; $order['customers_city'],
'postcode' =&gt; $order['customers_postcode'],
'state' =&gt; $order['customers_state'],
'country' =&gt; $order['customers_country'],
'format_id' =&gt; $order['customers_address_format_id'],
'telephone' =&gt; $order['customers_telephone'],
<strong>'fax' =&gt; $order['customers_fax'],</strong>
'email_address' =&gt; $order['customers_email_address']);

Here we have added “‘fax’ => $order[‘customers_fax’]” which is also required for adding fax number. It should be enough code modifications for adding fax number to admin/orders.php. The final step is to call fax number by using the following line of code.

1
<?php echo $order->customer['fax']; ?>

We may use it anywhere we want for fax number to appear. Therefore, we can go ahead and add fax number to the orders page in the admin backend.

Linux Cloud Server
Germany Cloud Servers
Brazil VPS
KVM VPS
Windows Cloud Server
Linux KVM Hosting
Ubuntu VPS
USA VPS
cPanel KVM
OpenVZ VPS
Rate this Tutorial:
No Comments Leave a Comment
Leave a Comment

Other (192)

Popular Keywords