Zen Follower
- Join Date:
- Sep 2005
- Posts:
- 173
- Plugin Contributions:
- 0
Super Orders v3.0 Support Thread (for ZC v1.3.9)
So, i made a few changes to super_invoice.php and now all non empty comments (including admin comments) are included in the invoice. The code is as follows:
// Find any comments entered at checkout
// and display on invoice if they exist
$orders_history = $db->Execute("SELECT orders_status_id, date_added, customer_notified, comments
FROM " . TABLE_ORDERS_STATUS_HISTORY . "
WHERE orders_id = '" . $oID . "'
ORDER BY date_added");
while (!$orders_history ->EOF) {
// check if note is empty, if yes, then skip it
if ($orders_history->fields['comments'] != '') {
$display_notes[] = $orders_history->fields['comments'];
}
$orders_history->MoveNext();
}
In particular the while loop is included to find all non empty comments.
and then at the bottom these are displayed:
<?php if (count($display_notes)>0) {?> <tr> <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '5'); ?></td> </tr> <tr> <td class="main" colspan="2"><strong><?php echo HEADER_CUSTOMER_NOTES; ?></strong></td> </tr> <?php for($i=0; $i<count($display_notes);$i++) { ?> <tr> <td class="main" colspan="2"><?php echo $display_notes[$i]; ?></td> </tr> <?php } ?> <?php } ?> </table>