You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Our site uses a "Custom Sale Method" for calculating a discount based on dollar amount at several levels.(see below)
Is there a way to exclude a specific catergory from this discount so that normal retail is always paid even though the customer is logged into their Distributor account?
Thanks,
Roger
****************************************************************
<?php
$cartids = $this->globals('ecom.checkout_cartids');
$user = $this->globals('khxc_user.id');
$group = $this->globals('khxc_user.usergroup');
$subtotal = 0;
$sale_amount = 0;
$sale_textshow = '';
if ((!(empty($user))) && ($group == 'wholesale')) {
foreach ($cartids as $cartid => $item) {
$subtotal = $subtotal + $item['subtotal'];
} // End of foreach statement.
if (($subtotal >= 60) && ($subtotal < 100)) {
$sale_amount = $subtotal * .20;
$sale_textshow = 'Wholesale Distributor Discount - 20% OFF';
} elseif (($subtotal >= 100) && ($subtotal < 300)) {
$sale_amount = $subtotal * .30;
$sale_textshow = 'Wholesale Distributor Discount - 30% OFF';
} elseif (($subtotal >= 300) && ($subtotal < 500)) {
$sale_amount = $subtotal * .40;
$sale_textshow = 'Wholesale Distributor Discount - 40% OFF';
} elseif ($subtotal >= 500) {
$sale_amount = $subtotal * .45;
$sale_textshow = 'Wholesale Distributor Discount - 45% OFF';
} // End of if statement.
} // End of if statement.
$this->globals('ecom.total_customsale',$sale_amount);
$this->globals('ecom.customsale_text',$sale_textshow);
?>
Offline