Zen Cart Only Show Gift Certificate Option on Payments Page if Customer has a Gift Certificate

Your zen cart payments page should be as simple as possible to avoid customers bouncing from the page and not completing their orders. By default, the gift certificate redeem box shows on the payments page during checkout whether a customer has a gift certificate balance or not. This can be confusing to customers, and makes the checkout process more complicated than it needs to be. This Easy Help Zen Cart Tutorial will show you how to only show the gift certificate redeem box on the payments page if a customer has a gift certificate balance. If a customer has a 0 gift certificate balance, the gift certificate redeem box will not show.

In your favorite plain text editor open the includes/modules/order_total/ot_gv.php file. Be sure to back this file up and make a note that you have edited this file for future upgrades since it is a core file.

Find this 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
                         )));

And change it to this:


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
                         )));
}

Save the file and upload it to your server making sure that you overwrite the file already on your server. Navigate to your checkout payments page and refresh your browser. The gift certificates redeem box should only show if the customer has a gift certificate balance greater than $0.00.

If you need help with your zen cart web siteplease contact us for a quote.

Picaflor Azul specializes in responsive zen cart design. Contact us to convert your current zen cart to a responsive design, or to have a fantastic new custom design made just for your business.

zen cart plus picaflor azul equals success

Leave a Reply