If this is your first visit, check our documentation. To post, register or login.

Modify the coupon module - add field

Locked

Started by i8flan on 19 Nov 2006, 8:40 PM · Views: 2,056

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
19 Nov 2006, 8:40 PM
#1
i8flan avatar

i8flan

New Zenner

Join Date:
Nov 2006
Posts:
7
Plugin Contributions:
0

Modify the coupon module - add field

I'm trying to add a field to the coupon section of the checkout page. I need to provide some of the discounts in a select box but still allow a code to be entered (we want to display some coupons to all, but hide others).

I have switched out the text box for a combo and have populated it with an array of visible options. Now I want to add in a text box below it.

Any ideas where I would put this into the code here (from ot_coupon.php):

    // note the placement of the redeem code can be moved within the array on the instructions or the title 
    $selection = array('id' => $this->code, 
                       'module' => $this->title, 
                       'redeem_instructions' => MODULE_ORDER_TOTAL_COUPON_REDEEM_INSTRUCTIONS . "" .  ($discount_coupon->fields['coupon_code'] != '' ? MODULE_ORDER_TOTAL_COUPON_REMOVE_INSTRUCTIONS : ''), 
                       'fields' => array(array('title' => ($discount_coupon->fields['coupon_code'] != '' ? MODULE_ORDER_TOTAL_COUPON_TEXT_CURRENT_CODE . '<a href="javascript:couponpopupWindow(\'' . zen_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $_SESSION['cc_id']) . '\')">' . $discount_coupon->fields['coupon_code'] . '</a><br />' : '') . MODULE_ORDER_TOTAL_COUPON_TEXT_ENTER_CODE, 
                                         //original text field, removed when select added -- 'field' => zen_draw_input_field('dc_redeem_code', '', 'id="disc-'.$this->code.'" onchange="submitFunction(0,0)"'), 
                                          'field' => zen_draw_pull_down_menu('dc_redeem_code', $couponarray,'','id="disc-'.$this->code.'" onchange="submitFunction(0,0)"'), 
                                          'tag' => 'disc-'.$this->code)
                                  ));

Thanks for any help!