Order Comments on Invoice - Code
Greetings:
Recently i added some code that i took from the Orders.php and added it to the Invoice.php. This means that now when i print my invoices it actually has the comments on the invoice as well.
Here is the coding i added..
Quote:
<tr>
<td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><table border="0" width="85%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="center" width="20%"><strong><?php echo TABLE_HEADING_DATE; ?></strong></td>
<td class="dataTableHeadingContent" align="center" width="80%"><strong><?php echo TABLE_HEADING_ORDER_COMMENTS; ?></strong></td>
</tr>
<?php
$orders_history = $db->Execute("select orders_status_id, date_added, customer_notified, comments
from " . TABLE_ORDERS_STATUS_HISTORY . "
where orders_id = '" . zen_db_input($oID) . "'
order by date_added");
if ($orders_history->RecordCount() > 0) {
while (!$orders_history->EOF) {
echo ' <tr class="dataTableRow">' . "\n" .
' <td class="dataTableContent" align="left">' . zen_datetime_short($orders_history->fields['date_added']) . '</td>' . "\n";
echo ' <td class="dataTableContent" align="left">' . nl2br(zen_db_output($orders_history->fields['comments'])) . ' </td>' . "\n" .
' </tr>' . "\n";
$orders_history->MoveNext();
}
} else {
echo ' <tr>' . "\n" .
' <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
' </tr>' . "\n";
}
?>
</table>
I added it below the following lines.
Quote:
<td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
<td class="main"><?php echo $order->info['payment_method']; ?></td>
</tr>
</table></td>
</tr>
But it is up to you where you stick it.
You will also need to add this to the Language - invoice.php file.
Quote:
define('TABLE_HEADING_ORDER_COMMENTS', 'Order Comments');
define('TABLE_HEADING_DATE', 'Date');
I added it below
Quote:
define('TABLE_HEADING_COMMENTS', 'Comments');
Re: Order Comments on Invoice - Code
Thanks for the update ... always a help to see ... :smile:
NOTE: this has been added to the upcoming v1.3.8 with options for:
Quote:
Do you want to display the Order Comments on the Admin Packing Slip?
0= OFF
1= First Comment by Customer only
2= All Comment for the Order
Just a handy thing to know ... for upgrades ... :cool:
Re: Order Comments on Invoice - Code
This worked Great! Thank you, just what I needed.
Re: Order Comments on Invoice - Code
Here comes a stupid one but where in the admin do you make the change to view the comments? I can't find it - I get lost sometimes.. Thanks!!
Re: Order Comments on Invoice - Code
In Zen Cart v1.3.8 ...
I thought tucking those order and customer comments for the invoice and packing slip in the Configuration ...Shipping/Packaging made sense ... :smile:
Quote:
Display Order Comments on Admin Invoice
Do you want to display the Order Comments on the Admin Invoice?
0= OFF
1= First Comment by Customer only
2= All Comments for the Order
Quote:
Display Order Comments on Admin Packing Slip
Do you want to display the Order Comments on the Admin Packing Slip?
0= OFF
1= First Comment by Customer only
2= All Comments for the Order
Re: Order Comments on Invoice - Code
I agree!
I only see:
Country of origin
postal code
max package wt
small to medium
large pckges
display number of boxes
order free shipping
shipping estimator display
I don't see anything about displaying comments..
I have 1.3.7 though.. that might be why. Ha.
Is there much to do to upgrade from 1.3.7 to .8 ? The only major mod I have installed are; edit orders and my own credit card mod..