Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Highlighting pending orders


_pleb

Recommended Posts

By default, with a large number of orders its very hard to see 'at a glance' which orders are pending (or processing) and which have been set to delivered, I'm trying to remedy this, and while my theory is pretty sound, the if statement itself is somehow wrong.

 

Here's what I added in admin/orders.php just above line 400 (which is if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {)

 

if ($order->status == '1') {

echo '<tr style="background-color: #FFB200;" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";

}

I then changed the isset($oInfo) line to become an elseif. ($order->status == '1') doesn't appear to do anything, and ($order->status = '1') highlights every row, regardless of status., I've also tried $status and $check_status as variables that might equal 1. It should be relatively easy, but I'm code blind at the moment.

 

Can anyone help? Surely someone else has needed to do this, if only to make their lives easier.

Link to comment
Share on other sites

try this:

             

if ($orders['orders_status_name'] != 'Shipped') {

  echo '<tr style="background-color: #FFB200;" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";

  }

  else

Blessings,

Tom

ScubaChick Incorporated

Link to comment
Share on other sites

Cool tip Tom, Thanks!! :D The whole section of code ended up looking like this:

 

//highlight pending
if ($orders['orders_status_name'] != 'Shipped') {
 echo '<tr style="background-color: #FFB200;" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";
 } else {   
     if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
       echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";
     } else {
       echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";
     }
 }

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...