I want to Only show gift certificate option on payment page if customer has a gift certificate balance available
Is this possible?
I want to Only show gift certificate option on payment page if customer has a gift certificate balance available
Is this possible?
In my case there's no gift codes, we add a gift card balance to the account so we only want to show the redemption option when the customer actually has a balance available
I believe to only show GVs when there is a customer balance and to not even ask for a GV code, you would change:
to read:Code:$selection = array('id' => $this->code, 'module' => $this->title, 'redeem_instructions' => MODULE_ORDER_TOTAL_GV_REDEEM_INSTRUCTIONS, 'checkbox' => $this->use_credit_amount(), 'fields' => array(array('title' => MODULE_ORDER_TOTAL_GV_TEXT_ENTER_CODE, 'field' => zen_draw_input_field('gv_redeem_code', '', 'id="disc-'.$this->code.'" onkeyup="submitFunction(0,0)"'), 'tag' => 'disc-'.$this->code )));
Code:if ($this->user_has_gv_account($_SESSION['customer_id']) > 0) { $selection = array('id' => $this->code, 'module' => $this->title, 'redeem_instructions' => MODULE_ORDER_TOTAL_GV_REDEEM_INSTRUCTIONS, 'checkbox' => $this->use_credit_amount(), 'fields' => array(array( 'tag' => 'disc-'.$this->code ))); }
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Are you saying a customer with a 0 GV balance still sees the GV info on the checkout_payment page?
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Could you post the code that you have for the function credit_selection() in the ot_gv.php file?
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
PHP Code:
/**
* check system to see if GVs should be made available or not. If true, then supply GV-selection fields on checkout pages
*/
function credit_selection() {
global $db, $currencies;
$gv_query = $db->Execute("select coupon_id from " . TABLE_COUPONS . " where coupon_type = 'G' and coupon_active='Y'");
// checks to see if any GVs are in the system and active or if the current customer has any GV balance
if ($gv_query->RecordCount() > 0 || $this->use_credit_amount()) {
if ($this->user_has_gv_account($_SESSION['customer_id']) > 0) {
$selection = array('id' => $this->code,
'module' => $this->title,
'redeem_instructions' => MODULE_ORDER_TOTAL_GV_REDEEM_INSTRUCTIONS,
'checkbox' => $this->use_credit_amount(),
'fields' => array(array(
'tag' => 'disc-'.$this->code
)));
}
return $selection;
}
/**
Looks like you have and error in the brackets, try using:
Code:function credit_selection() { global $db, $currencies; $gv_query = $db->Execute("select coupon_id from " . TABLE_COUPONS . " where coupon_type = 'G' and coupon_active='Y'"); // checks to see if any GVs are in the system and active or if the current customer has any GV balance if ($gv_query->RecordCount() > 0 || $this->use_credit_amount()) { if ($this->user_has_gv_account($_SESSION['customer_id']) > 0) { $selection = array('id' => $this->code, 'module' => $this->title, 'redeem_instructions' => MODULE_ORDER_TOTAL_GV_REDEEM_INSTRUCTIONS, 'checkbox' => $this->use_credit_amount(), 'fields' => array(array( 'tag' => 'disc-'.$this->code ))); } } return $selection; }
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Bookmarks