Add this function to the:
/admin/includes/functions/general.php
PHP Code:
function zen_user_has_gv_balance($c_id) {
global $db;
$gv_result = $db->Execute("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . (int)$c_id . "'");
if ($gv_result->RecordCount() > 0) {
if ($gv_result->fields['amount'] > 0) {
return $gv_result->fields['amount'];
}
}
return 0;
}
The edit the file:
/admin/customers.php
And change:
PHP Code:
$contents[] = array('text' => '<br />' . TEXT_INFO_GV_AMOUNT . ' ' . $currencies->format($customers_orders->fields['amount']));
to read:
PHP Code:
$customer_gv_balance = zen_user_has_gv_balance($cInfo->customers_id);
$contents[] = array('text' => '<br />' . TEXT_INFO_GV_AMOUNT . ' ' . $currencies->format($customer_gv_balance));
Bookmarks