One of the big issues with dual pricing is the lack of configuration when it comes to hide the coupon and gift cert. boxes during checkout. The last thing as we want as wholesalers is give more discounts in the form of coupons or for wholesale accounts to pay with gift certificates. We've been trying to find a way around this without modifying core files and I think we just came up with a good way, at least it works for me, and I wanted to share it.
On includes>templates>YOUR TEMPLATE>templates>tpl_checkout_payment_default.php locate the following piece of code:
<?php
$selection = $order_total_modules->credit_selection();
if (sizeof($selection)>0) {
for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
if ($_GET['credit_class_error_code'] == $selection[$i]['id']) {
?>
<div class="messageStackError"><?php echo zen_output_string_protected($_GET['credit_class_error']); ?></div>
<?php
}
for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
?>
<div id="shippingcoupongift"><fieldset>
<legend><?php echo $selection[$i]['module']; ?></legend>
<?php echo $selection[$i]['redeem_instructions']; ?>
<div class="gvBal larger"><?php echo $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']; ?>
</fieldset>
</div>
<?php
}
}
?>
<?php
}
?>
and replace by this one
<?php
$selection = $order_total_modules->credit_selection();
if (sizeof($selection)>0) {
for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
if ($_GET['credit_class_error_code'] == $selection[$i]['id']) {
?>
<div class="messageStackError"><?php echo zen_output_string_protected($_GET['credit_class_error']); ?></div>
<?php
}
for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
?>
<!-- bof don't show if customer wholesale -->
<?php if ($_SESSION['customer_whole'] && $_SESSION['customer_whole'] != '0' ) { ?>
<?php } else { ?>
<!-- closing tag for this above bellow -->
<div id="shippingcoupongift"><fieldset>
<legend><?php echo $selection[$i]['module']; ?></legend>
<?php echo $selection[$i]['redeem_instructions']; ?>
<div class="gvBal larger"><?php echo $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']; ?>
</fieldset>
</div>
<?php } ?>
<!-- bof don't show if customer wholesale -->
<?php
}
}
?>
<?php
}
?>
This code will prevent the block of boxes (coupon code, gift cert., plastic gift card and insurance optional) to show for wholesale accounts only but shows and works fine for retail.
The problem, for us at least, is that it would also remove the optional insurance module, but we solved it by adding insurance mandatory for orders over $200 which is the same amount we use as minimum order for wholesale accounts, so we made it work.
We've tested it in one of my live stores https://www.byvalenti.com and it works great.
I hope this hack will be useful for somebody else :smile: at least until there is a better way :P
cheers! :D