AldianP Posted April 27, 2009 Posted April 27, 2009 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
theherbman Posted April 27, 2009 Posted April 27, 2009 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
AldianP Posted April 28, 2009 Author Posted April 28, 2009 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
AldianP Posted May 15, 2009 Author Posted May 15, 2009 Anyone? Please... Aldian Prakoso - Blog Monetization Strategist
rockroach Posted June 12, 2009 Posted June 12, 2009 Anyone? Please... 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.
AldianP Posted June 12, 2009 Author Posted June 12, 2009 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
rockroach Posted June 12, 2009 Posted June 12, 2009 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.
FIMBLE Posted June 12, 2009 Posted June 12, 2009 Does not suck you cheeky sod, its for the latest version i take great offence at your suggestion my contribution "Sucks" Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
rockroach Posted June 12, 2009 Posted June 12, 2009 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.
rockroach Posted June 12, 2009 Posted June 12, 2009 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.
AldianP Posted June 13, 2009 Author Posted June 13, 2009 Wow thanks a lot Robert! It finally shows the phone number in the order page! :) Aldian Prakoso - Blog Monetization Strategist
AldianP Posted June 13, 2009 Author Posted June 13, 2009 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
rockroach Posted June 13, 2009 Posted June 13, 2009 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.
rockroach Posted June 18, 2009 Posted June 18, 2009 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.
AldianP Posted June 19, 2009 Author Posted June 19, 2009 Thanks a lot Robert! It works like a charm :) I love it so much! Aldian Prakoso - Blog Monetization Strategist
Recommended Posts
Archived
This topic is now archived and is closed to further replies.