Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Status comments on packing slip


adz1976

Recommended Posts

Hi All

 

Just hope someone could answer this little prob I have in the code below, I guess it's quite simple but

not to sure what to do.

 

I have tried a few different things to get this working but still no success :(

 

What I am trying to do:

 

show the comments from the status (pending) but no other comments to be shown from other status.

ie processing, item sent.

 

I understand the info is coming from the table:

(orders_history_status) & in this table,

there is a field (comments)

but with the code below it includes all comments for each status because the order_status_id is for all.

 

Am presume there could be a statement <1 or =1 for the order_status_id or something on these lines in the code below but I don't know how or where to put this code.

 

<?php

$orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");

if (tep_db_num_rows($orders_history_query)) {

while ($orders_history = tep_db_fetch_array($orders_history_query)) {

echo ' <tr>' . "\n" .

' <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .

' <td class="smallText" align="center">';

if ($orders_history['customer_notified'] == '1') {

echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";

} else {

echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";

}

echo ' <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" .

' <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" .

' </tr>' . "\n";

}

} else {

echo ' <tr>' . "\n" .

' <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .

' </tr>' . "\n";

}

?>

 

Many thanks in advance & hope it's possible

 

Adam :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...