Kryptronic Software Support Forum

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.

#1 10-21-2008 21:43:38

rtringo
Member
Registered: 06-22-2005
Posts: 95

Categroy exclusion from Custom Sale Method

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

 

Board footer