Only show gift certificate option on payment page if customer has a gift certificate
I want to Only show gift certificate option on payment page if customer has a gift certificate balance available
Is this possible?
Re: Only show gift certificate option on payment page if customer has a gift certific
Quote:
Originally Posted by
ShopVille
I want to Only show gift certificate option on payment page if customer has a gift certificate balance available Is this possible?
How will you handle the situation where they have a gift code but haven't redeemed it yet?
Do you want to hide the redemption part as well?
Re: Only show gift certificate option on payment page if customer has a gift certific
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
Re: Only show gift certificate option on payment page if customer has a gift certific
I believe to only show GVs when there is a customer balance and to not even ask for a GV code, you would change:
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
)));
to read:
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
)));
}
Re: Only show gift certificate option on payment page if customer has a gift certific
Quote:
Originally Posted by
Ajeh
I believe to only show GVs when there is a customer balance and to not even ask for a GV code, you would change:
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
)));
to read:
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
)));
}
Thanks but it didn't seem to change anything
Re: Only show gift certificate option on payment page if customer has a gift certific
Are you saying a customer with a 0 GV balance still sees the GV info on the checkout_payment page?
Re: Only show gift certificate option on payment page if customer has a gift certific
Quote:
Originally Posted by
Ajeh
Are you saying a customer with a 0 GV balance still sees the GV info on the checkout_payment page?
Yes.
Oh i need 7 characters
Re: Only show gift certificate option on payment page if customer has a gift certific
Could you post the code that you have for the function credit_selection() in the ot_gv.php file?
Re: Only show gift certificate option on payment page if customer has a gift certific
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;
}
/**
Re: Only show gift certificate option on payment page if customer has a gift certific
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;
}