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.
If the script your trying to update is what is posted in post #23, then it should look like this with the add code
<?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')) { $excludeids = array('lfn1','lfn2'); foreach ($cartids as $cartid => $item) { $productid = $item['id']; if (!in_array($productid,$excludeids)) { $subtotal = $subtotal + $item['subtotal']; } } // End of if statement. // 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); ?>
keep in mind that this still may not get what you need as when you exclude an item from something it is usually best to create an alternate way to treat that product, in this example it only keep the subtotal from being updated with the item subtotal.
John
Offline
Hi DH783,
This is just great.
I plugged in the code you suggested and it works!
Thanks a lot for your support and followup.
Looking forward to CCP7. Patience is a virtue when waiting for Xmas
Roger
Offline