Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Show 'status name' on orders.php HEADING TEXT


Gazonice

Recommended Posts

Posted

Hi,

 

I am trying to modify the heading of orders.php to display both the order number and the status of the order.

 

I have amended the code so far to add the order number to the heading but I cannot work out how to add the orders status as well.

 

Can anyone point me in the right direction or show me what I would need to add to complete the line?

 

so far:

 

<?php echo HEADING_TITLE_ORDER_NUMBER . ' ' . $_GET['oID']; ?>

 

Thanks in advance,

 

Garry

Garry

Posted

Hi,

 

I am trying to modify the heading of orders.php to display both the order number and the status of the order.

 

I have amended the code so far to add the order number to the heading but I cannot work out how to add the orders status as well.

 

Can anyone point me in the right direction or show me what I would need to add to complete the line?

 

so far:

 

<?php echo HEADING_TITLE_ORDER_NUMBER . ' ' . $_GET['oID']; ?>

 

Thanks in advance,

 

Garry

You're probably going to need a function to get that information, since you want it display in the header before the page is display. Your MySQL query would be as follows:

 

tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS ." where orders_status_id = (select orders_status_id from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id='" . $_GET['oID'] . "' order by date_added DESC limit 1);");

 

This will return the status name of the current status of the order. Take a look at the function tep_count_customers_orders in your /includes/functions/general.php for a general idea of the format. Let me know if you need any help. AND as always, backup your file before to do any editing...

 

Frank

Posted

Thank you very much for the help !

 

Added to admin/functions/general.php:

 

 

/////get orders status

function tep_customer_orders_status() {

$tep_order_status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS ." where orders_status_id = (select orders_status_id from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id='" . $_GET['oID'] . "' order by date_added DESC limit 1);");

$tep_order_status = tep_db_fetch_array($tep_order_status_query);

return $tep_order_status['orders_status_name'];

}

 

 

Modified orders.php:

 

 

<?php echo HEADING_TITLE_ORDER_NUMBER . ' ' . $_GET['oID'] . ' ' . HEADING_TITLE_STATUS . ' ' . tep_customer_orders_status(); ?>

 

 

So when my clients view individual orders in conjunction with the "Admin Previous/Next Order" contribution at the top of orders.php they can quickly skip through the orders and deal with the Pendings or Processing's and bypassing the completed orders.

 

Much Appreciated.

 

Garry

Garry

Archived

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

×
×
  • Create New...