Here's a patch to let customers view their own credit limit and available credit.
--- old-store/account_edit.php 2006-03-22 15:26:36.000000000 -0500
+++ new-store/account_edit.php 2006-03-22 15:26:36.000000000 -0500
@@ -113,7 +113,7 @@
}
}
- $account_query = tep_db_query("select customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_telephone, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
+ $account_query = tep_db_query("select customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_telephone, customers_fax, customers_credit_account_status, customers_credit_status, customers_credit_amount, customers_credit_left from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
$account = tep_db_fetch_array($account_query);
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
@@ -226,11 +226,19 @@
<td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
<td class="main"><?php echo tep_draw_input_field('fax', $account['customers_fax']) . ' ' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></td>
</tr>
- </table></td>
+
+ <?php if (($account['customers_credit_account_status'] == 1) && ($account['customers_credit_status'] ==1)) { ?>
+ <tr><td class="main">Credit Limit: </td> <td class="main"> $<?php echo $account['customers_credit_amount'] ?> </td></tr>
+ <tr><td class="main">Available Credit: </td><td class="main"> $<?php echo $account['customers_credit_left'] ?> </td></tr>
+<?php } ?>
+ </table>
+ </td>
</tr>
- </table></td>
+ </table>
+ </td>
</tr>
- </table></td>
+ </table>
+ </td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>