Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Status block on Invoice


Guest

Recommended Posts

Hi,

need a little customizing help if someone can lend a hand. Because we have various stages the product must go through we decided the comments block should be on the invoice.

 

By taking the comments code out of the admin/orders.php and placing it in the admin/invoice.php we were able to get the comments block to show up in the invoice.

 

statusblock.GIF

 

 

As you can see almost everything works. I cannot get the status block to work. Any hints?

 

Here is the code I copied over

<table border="1" cellspacing="0" cellpadding="5">

         <tr>

           <td class="smallText" align="center"><b>Date Added</b></td>

           <td class="smallText" align="center"><b>Notified</b></td>

           <td class="smallText" align="center"><b>Status</b></td>

           <td class="smallText" align="center"><b>Comments</b></td>

         </tr>

<?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";

   }

?>

       </table>

Link to comment
Share on other sites

Hi,

 

Try this.....

 

After the following line in admin/invoice.php

 

  $currencies = new currencies();

 

add these lines.......

 

  $orders_statuses = array();

 $orders_status_array = array();

 $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");

 while ($orders_status = tep_db_fetch_array($orders_status_query)) {

   $orders_statuses[] = array('id' => $orders_status['orders_status_id'],

                              'text' => $orders_status['orders_status_name']);

   $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];

 }

 

Hopefully that should help!?

 

Back up before you try!

Reddy to Rumble

 

Thank you osCommerce and all who Contribute to her!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...