Okay, guys. New code to get it to work better thanks to input from abcisme (good catch).
This works for me. So to consolidate:
In /includes/modules/order_total/ot_gv.php, line 48 (for me) looks like this:
PHP Code:
if (!zen_not_null(ltrim($_SESSION['cot_gv'], ' 0')) || $_SESSION['cot_gv'] == '0') $_SESSION['cot_gv'] = '0.00';
and needs to be changed to:
PHP Code:
if (!zen_not_null(ltrim($_SESSION['cot_gv'], ' 0')) || $_SESSION['cot_gv'] == '0') $_SESSION['cot_gv'] = $this->user_has_gv_account($_SESSION['customer_id']);
The new change (lines 263-264 for me) looked like this:
PHP Code:
// zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_REDEEMED_AMOUNT. $currencies->format($gv_amount)), 'SSL'));
$messageStack->add_session('redemptions',ERROR_REDEEMED_AMOUNT. $currencies->format($gv_amount), 'success' );
and needs to be changed to:
PHP Code:
$_SESSION['cot_gv'] = $this->user_has_gv_account($_SESSION['customer_id']);
$messageStack->add_session('redemptions',ERROR_REDEEMED_AMOUNT. $currencies->format($gv_amount), 'success' );
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_REDEEMED_AMOUNT. $currencies->format($gv_amount)), 'SSL'));
(please note the first new line to pull the new gift balance)
This will redirect it back to the payment page after processing the gift certificate and it will update the amount to use to be their new balance. They can then change it if they want to before proceeding.
Bookmarks