Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to show customer phone number in the Administration Orders page?


AldianP

Recommended Posts

Posted

I added this code in the admin/orders.php but it didn't show anything in the Administration Orders page:

 

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

 

 

I really appreciate it if you can help me showing the customer phone numbers in the Administration Orders page.

Aldian Prakoso - Blog Monetization Strategist

Posted
I added this code in the admin/orders.php but it didn't show anything in the Administration Orders page:

 

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

 

 

I really appreciate it if you can help me showing the customer phone numbers in the Administration Orders page.

 

The telephone number is already there if the customer has put it onto their account details from the admin page click customer then choose the customer and then edit. Its also on the customer orders page choose customer and then edit

 

Regards Mel

Posted

I mean without clicking "Edit". With my slow Internet connection, it's wasting time to click each customer's "Edit" to see their phone number.

 

It'll be time saving if phone number can be shown on Orders page so that I can promptly follow-up customers who order.

So I'd love it if you can show me how to do it.

 

The telephone number is already there if the customer has put it onto their account details from the admin page click customer then choose the customer and then edit. Its also on the customer orders page choose customer and then edit

 

Regards Mel

Aldian Prakoso - Blog Monetization Strategist

  • 3 weeks later...
  • 4 weeks later...
Posted
I'm sorry, I've only just seen this post.

 

Please have a look at this contribution, it should help you understand how to add columns of info:

 

http://www.oscommerce.com/community/contributions,5926

 

If you need any further help, please let me know.

 

Thanks Robert but unfortunately I can't use since the contribution doesn't work with ver 2.2 :'(

Aldian Prakoso - Blog Monetization Strategist

Posted
Thanks Robert but unfortunately I can't use since the contribution doesn't work with ver 2.2 :'(

 

That sucks.

 

Okay, I'll work it out and get back to you.

Posted
Does not suck you cheeky sod, its for the latest version i take great offence at your suggestion my contribution "Sucks"

 

Huh? It sucks that Aldian couldn't get it to work with his version of osCommerce.

 

I would never have suggested it if I thought the contribution itself sucked. In fact I use that contribution, have done for a while now, and it works fine for me.

 

Thank you for making it.

Posted

Okay, to the job at hand.

 

Edit admin/includes/languages/english/orders.php and add the following:

 

define('TABLE_HEADING_CUSTOMERS_TELEPHONE', 'Telephone Number');

 

Edit admin/orders.php and do a search for "dataTableHeadingContent", you want the second block of text that has this.

 

Add the following text to that:

 

				<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_CUSTOMERS_TELEPHONE; ?></td>

 

Just below this you should see something similar to this, you can see that I've added "o.customers_telephone" 3 times:

 

	if (isset($HTTP_GET_VARS['cID'])) {
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_telephone, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, 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), " . 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 o.orders_id, o.customers_name, o.customers_telephone, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, 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), " . 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' order by o.orders_id DESC";
} else {
  $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_telephone, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, 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), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
}

 

A few lines further down you'll find a block of text with "dataTableContent" in it and add the following:

 

				<td class="dataTableContent"><?php echo $orders['customers_telephone']; ?></td>

 

A few lines further down again, you'll see something like this:

 

<td colspan="5">

 

Every time you added a column, increase the the number otherwise the page number widget will drift to the left. In our case 1 up is 6:

 

<td colspan="6">

 

And that's it, job done.

Posted

Wow thanks a lot Robert! It finally shows the phone number in the order page! :)

Aldian Prakoso - Blog Monetization Strategist

Posted

Hi Robert, I wonder if you can help again?

 

I added fax number following the same method and added o.customers_fax in the admin/order.php but I got this error message. I'm confused where I got wrong?

 

 

1054 - Unknown column 'o.customers_fax' in 'field list'

 

select o.orders_id, o.customers_name, o.customers_telephone, o.customers_fax, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by o.orders_id DESC limit 0, 20

Aldian Prakoso - Blog Monetization Strategist

Posted
Hi Robert, I wonder if you can help again?

 

I added fax number following the same method and added o.customers_fax in the admin/order.php but I got this error message. I'm confused where I got wrong?

 

 

1054 - Unknown column 'o.customers_fax' in 'field list'

 

select o.orders_id, o.customers_name, o.customers_telephone, o.customers_fax, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by o.orders_id DESC limit 0, 20

 

What's wrong is that there is no "customers_fax" field in the "orders" table. Use something like phpMyAdmin on your database and you'll be able to spot that.

 

To fetch the customers fax number you either need to query the "customers" table separately or modify osCommerce and the "orders" table so that it is available.

 

I'll see what I can come up with later on today.

Posted

Sorry for the delay, I'm so far behind with so many things. :P

 

Okay, to the job at hand again.

 

Edit admin/includes/languages/english/orders.php and add the following:

 

define('TABLE_HEADING_CUSTOMERS_FAX', 'Fax Number');

 

Edit admin/orders.php and do a search for "dataTableHeadingContent", you want the second block of text that has this.

 

Add the following text to that:

 

				<th class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS_FAX; ?></th>

 

Just below this you should see something similar to this, you can see that I've added "c.customers_fax" and "left join " . TABLE_CUSTOMERS . " c on (o.customers_id = c.customers_id)" 3 times:

 

	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, 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.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, 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' order by o.orders_id DESC";
} else {
  $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, 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' order by o.orders_id DESC";
}

 

A few lines further down you'll find a block of text with "dataTableContent" in it and add the following:

 

				<td class="dataTableContent"><?php echo $orders['customers_fax']; ?></td>

 

A few lines further down again, you'll see something like this:

 

<td colspan="6">

 

Every time you added a column, increase the the number otherwise the page number widget will drift to the left. In our case 1 up is 7:

 

<td colspan="7">

 

And that's it, job done.

Posted

Thanks a lot Robert! It works like a charm :) I love it so much!

Aldian Prakoso - Blog Monetization Strategist

Archived

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

×
×
  • Create New...