Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Order Number Display in admin/orders


Recommended Posts



I'm wondering if it is at all possible to display the order number in the admin orders screen, like in its own feild before the customer name, or append it to the end of their name etc.


I've looked everywhere i can and can't find a solution on the board or the Knowleadge Base.


Im thinking that maybe i can go to where the orders page grabs the order customer's name, and stick on the end of it the variable that holds the order number? sure it will be ugly, but will it work?


Any ideas?


Thanks alot,



Link to comment
Share on other sites

Maybe something like running the bit :

  tep_db_perform(TABLE_ORDERS, $sql_data_array);
 $insert_id = tep_db_insert_id();
 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
   $sql_data_array = array('orders_id' => $insert_id,


if i add that into the php file that lists the orders page in admin (admin/orders.php?) then after the varible customer name is pasted, put a space and a sperater, then paste in the varible $insert_id



Will that work? ill probably try it in a min anyway, but any help would be appiecated :P


Thanks again

Link to comment
Share on other sites

There's some rather snazzy code in the Download Controller thread for this, I seem to recall....ah....here it is - goes in orders.php - rather spiffing actually, although I had to do some minor tweaking so it could work alongside Step by Step :)

Link to comment
Share on other sites

  • 2 weeks later...
Ok, i got it, its already set as "order_id", so i just made a new coloum in the table and listed them, works great :)



Sykotic may have a more elegant solution, but here's what I did and it appears to work beautifully. Just find the relevant sections of code in admin/orders.php, then paste in the line(s) that I have enclosed in comments.


              <tr class="dataTableHeadingRow">
            	 <!-- SUBZERO this next line with "ID" in it is my own, to show order id in heading -->
               <td class="dataTableHeadingContent">ID</td>
               <!-- SUBZERO the previous line with "ID" in it is my own, to show order id in heading -->
               <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>
               <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>


       <!-- SUBZERO following line with orders_id is my own, to enter order ID -->
       <td class="dataTableContent" align="left"><?php echo strip_tags($orders['orders_id']); ?></td>
       <!-- SUBZERO preceding line with orders_id is my own, to enter order ID -->
               <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $orders['customers_name']; ?></td>
               <td class="dataTableContent" align="right"><?php echo strip_tags($orders['order_total']); ?></td>
               <td class="dataTableContent" align="center"><?php echo tep_datetime_short($orders['date_purchased']); ?></td>
               <td class="dataTableContent" align="right"><?php echo $orders['orders_status_name']; ?></td>
               <td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>

Link to comment
Share on other sites


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

  • Create New...