
Originally Posted by
lat9
You can "hide" that button via CSS. Just update your template's version of /css/checkout_one.css and add something akin to
Code:
#disc-ot_insurance+div.buttonRow { display: none; }
Just use your browser's 'element inspector' and make sure that the
id= attribute on the
ot_insurance input matches the value above.
Thank you so much for all your help! That works PERFECTLY!!
Just to document what I did (for anyone else wanting to accomplish the same), I made two changes to the code.
1. Since your template is the one that adds the Apply button on the checkout page, I modified the tpl_opc_credit_selections.php to assign a unique class name to ONLY the insurance block.
I changed this (line 54):
Code:
<div class="buttonRow forward"><?php echo zen_image_button(BUTTON_IMAGE_SUBMIT, ALT_TEXT_APPLY_DEDUCTION, $additional_parms, $secondary_class); ?></div>
And replaced it with this:
Code:
<?php
if(strpos($current_selection['module'],"Shipping Insurance") !== false){
?>
<div class="buttonRow forward ot-insurance"><?php echo zen_image_button(BUTTON_IMAGE_SUBMIT, ALT_TEXT_APPLY_DEDUCTION, $additional_parms, $secondary_class); ?></div>
<?php
}
else {
?>
<div class="buttonRow forward"><?php echo zen_image_button(BUTTON_IMAGE_SUBMIT, ALT_TEXT_APPLY_DEDUCTION, $additional_parms, $secondary_class); ?></div>
<?php
}
?>
There is probably a better (and prettier) way to accomplish that, but I'm not a native PHP programmer. :)
2. Finally, I simply edited your checkout_one.css file to add the following line:
Code:
.ot-insurance { display: none; }
Those changes (along with the previous posts of ours) made the module work exactly as we wanted! The customer can now click to apply insurance, it will update the form totals automatically, and the now-redundant "Apply" button has been removed from that Insurance block (without removing it from others like Coupons and Gift Certificates, etc).
Thanks again for all your help, Lat9!
Bookmarks