Zen Cart Logo
Forums / Bug Reports / [DONE] Account History/Repeated Order Status Headers

[DONE] Account History/Repeated Order Status Headers

Locked

Views: 2,639

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
4 Jun 2006, 4:17 PM
#1
rispku avatar

rispku

New Zenner

Join Date:
Jun 2006
Posts:
9
Plugin Contributions:
0

[DONE] Account History/Repeated Order Status Headers

The default template for the account_history_info page adds an entirely new table for every status update. I'm not sure if this was intentional, but it does look somewhat odd. I corrected it by overriding the tpl_account_history_info_default.php template and changing the following code from this:

<?php
  foreach ($statusArray as $statuses) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0" id="myAccountOrdersStatus" summary="Table contains the date, order status and any comments regarding the order">
<caption><h2 id="orderHistoryStatus"><?php echo HEADING_ORDER_HISTORY; ?></h2></caption>
    <tr class="tableHeading">
        <th scope="col" id="myAccountStatusDate"><?php echo TABLE_HEADING_STATUS_DATE; ?></th>
        <th scope="col" id="myAccountStatus"><?php echo TABLE_HEADING_STATUS_ORDER_STATUS; ?></th>
        <th scope="col" id="myAccountStatusComments"><?php echo TABLE_HEADING_STATUS_COMMENTS; ?></th>
       </tr>
    <tr>
        <td><?php echo zen_date_short($statuses['date_added']); ?></td>
        <td><?php echo $statuses['orders_status_name']; ?></td>
        <td><?php echo (empty($statuses['comments']) ? ' ' : nl2br(zen_output_string_protected($statuses['comments']))); ?></td> 
     </tr>
</table>
<?php
  }
?>

To this:

<?php
  if ($statusArray) {
?>
<table border="1" width="100%" cellspacing="0" cellpadding="2" id="myAccountOrdersStatus" summary="Table contains the date, order status and any comments regarding the order">
<caption><h2 id="orderHistoryStatus"><?php echo HEADING_ORDER_HISTORY; ?></h2></caption>
    <tr class="tableHeading">
        <th scope="col" id="myAccountStatusDate"><?php echo TABLE_HEADING_STATUS_DATE; ?></th>
        <th scope="col" id="myAccountStatus"><?php echo TABLE_HEADING_STATUS_ORDER_STATUS; ?></th>
        <th scope="col" id="myAccountStatusComments"><?php echo TABLE_HEADING_STATUS_COMMENTS; ?></th>
       </tr>
<?
  foreach ($statusArray as $statuses) {
?>
	<tr>
        <td><?php echo zen_date_short($statuses['date_added']); ?></td>
        <td><?php echo $statuses['orders_status_name']; ?></td>
        <td><?php echo (empty($statuses['comments']) ? ' ' : nl2br(zen_output_string_protected($statuses['comments']))); ?></td> 
	</tr>
<?php
  }
?>
</table>
<?php
  }
?>

Note: I did modify the table attributes as well, but this isn't necessary to correct the aforementioned problem.

I'm quite sure the if statement isn't necessary, however, I added it just in case. ;)