
Originally Posted by
DrByte
Maybe try this:
Code:
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" name="formfieldnamehere" value="1" id="nameTheInputIdHere">
<label class="custom-control-label" for="nameTheInputIdHere" title="help msg here">Text In Browser Here</label>
</div>
Thanks. I added code to includes/templates/CUSTOM/templates/tpl_checkout_payment_default.php to do this for checkboxes.
From:
Code:
<!--bof discount coupon card-->
<div id="discountCoupon-card" class="card mb-3">
<h4 id="discountCoupon-card-header" class="card-header">
<?php echo $selection[$i]['module']; ?></h4>
<div id="discountCoupon-card-body" class="card-body p-3">
<?php echo $selection[$i]['redeem_instructions']; ?>
<div id="discountCoupon-gvBal"><?php echo (isset($selection[$i]['checkbox'])) ? $selection[$i]['checkbox'] : ''; ?></div>
<label class="inputLabel"<?php echo ($selection[$i]['fields'][$j]['tag']) ? ' for="'.$selection[$i]['fields'][$j]['tag'].'"': ''; ?>><?php echo $selection[$i]['fields'][$j]['title']; ?></label>
<?php echo $selection[$i]['fields'][$j]['field']; ?>
</div>
</div>
<!--eof discount coupon card-->
To:
Code:
<!--bof discount coupon card-->
<div id="discountCoupon-card" class="card mb-3">
<h4 id="discountCoupon-card-header" class="card-header"><?php echo $selection[$i]['module']; ?></h4>
<div id="discountCoupon-card-body" class="card-body p-3">
<?php
echo $selection[$i]['redeem_instructions'];
if (strpos($selection[$i]['fields'][$j]['field'], 'type="checkbox"') === false) { // filter out checkboxes
if (isset($selection[$i]['checkbox'])) {
?>
<div id="discountCoupon-gvBal"><?php echo $selection[$i]['checkbox']; ?></div>
<?php
}
?>
<label class="inputLabel"<?php echo isset($selection[$i]['fields'][$j]['tag']) ? ' for="'.$selection[$i]['fields'][$j]['tag'].'"': ''; ?>><?php echo $selection[$i]['fields'][$j]['title']; ?></label>
<?php
echo $selection[$i]['fields'][$j]['field'];
} else { // process checkboxes
?>
<div class="custom-control custom-checkbox">
<?php echo $selection[$i]['fields'][$j]['field']; ?>
<label class="custom-control-label"<?php echo isset($selection[$i]['fields'][$j]['tag']) ? ' for="'.$selection[$i]['fields'][$j]['tag'].'"': ''; ?>><?php echo $selection[$i]['fields'][$j]['title']; ?></label>
</div>
<?php
}
?>
</div>
</div>
<!--eof discount coupon card-->
It made more sense to me to do this rather than modifying the Order Total add-on since it's specific to the current template.