Originally Posted by
kwright
Woot, use to love riding out in Mojave, Red Rocks and Jawbone too!
Thanks for the suggestions. 1.5.4 is a bit different than 1.5.5 in this area. I was able to move all of the <fieldset> data that only needed to be displayed once outside of the for loop. Added the extra field to the fields array, works great! I can now use this same method for the Your Store Gift Cards mod and add a CVV field, which our gift cards use.
Enjoy!
OK.. turns out the location of where the code change is works the same for both 154 and 155... so, this is super simple without error or testing of any kind, just like its working without the split...
in ot_coupon.php find line
Code:
'field' => zen_draw_input_field('dc_redeem_code', '', 'id="disc-' . $this->code . '" onkeyup="submitFunction(0,0)"'),
Change to
Code:
'field' => zen_draw_input_field('green_redeem_code', '', 'id="disc-' . $this->code . '"') . '<label>Enter Green code above and Red code below.</lable>' . zen_draw_input_field('red_redeem_code', '', 'id="disc2-' . $this->code . '" onkeyup="submitFunction(0,0)"') . zen_draw_hidden_field('dc_redeem_code'),
then in includes/modules/pages/checkout_payment/jscript_main.php
find
Code:
function submitFunction($gv,$total) {
if ($gv >=$total) {
submitter = 1;
}
}
change to
Code:
function submitFunction($gv,$total) {
if ($gv >=$total) {
submitter = 1;
}
var red = $(":input[name=red_redeem_code]").val();
var green = $(":input[name=green_redeem_code]").val();
$(":input[name=dc_redeem_code]").val(green+red);
}
So what's going on here..
in ot_coupon.php we changed the one input to a name of green_redeem_code and added a label to enplane what to do, added another input with a name of red_redeem_code and a hidden input field with the old name so its as if it was a single field as before.
In the script side we didn't do any testing! We just got the two fields and combined them into one and forced it into the hidden field in the coupon side... This leaves the coupon code to act as it would with only one field. I left the on key up in one field, which is excessive.
After toying around with the coupons, I see very little feed back to a user for entering the wrong code... I would change that process to make it more user friendly..
Bookmarks