I found this thread http://www.zen-cart.com/showthread.p...Customer-Group and followed what was suggested and my Tax Exempt group is still having taxes added.
This is from my functions_taxes.php file
PHP Code:
function zen_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {
global $db;
// added to make groups tax exempt. See also includes/modules/order_total/ot_group_pricing.php
if(isset($_SESSION['tax_exempt'])){
return 0;
}
// end tax exempt
...
This is from my ot_group_pricing.php file
PHP Code:
function get_order_total() {
global $order;
$order_total_tax = $order->info['tax'];
$order_total = $order->info['total'];
if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost'];
if ($this->include_tax != 'true') $order_total -= $order->info['tax'];
if (DISPLAY_PRICE_WITH_TAX == 'true' && $this->include_shipping != 'true')
{
$order_total += $order->info['shipping_tax'];
}
$taxGroups = array();
foreach ($order->info['tax_groups'] as $key=>$value) {
if (isset($_SESSION['shipping_tax_description']) && $key == $_SESSION['shipping_tax_description'])
{
if ($this->include_shipping != 'true')
{
$value -= $order->info['shipping_tax'];
}
}
$taxGroups[$key] = $value;
}
$orderTotalFull = $order_total;
$order_total = array('totalFull'=>$orderTotalFull, 'total'=>$order_total, 'tax'=>$order_total_tax, 'taxGroups'=>$taxGroups);
// added to make groups tax exempt. See also includes/functions/functions_taxes.php
$groupname=$group_discount->fields['group_name'];
if(eregi("Tax Exempt",$groupname)){$_SESSION['tax_exempt']=TRUE;}
// end tax exempt
return $order_total;
}
The name of my group is Wholesale (Tax Exempt)
I've tried to printout the session variables using this but tax_exempt is not listed:
PHP Code:
<!-- Print Session Variables BEGIN -->
<?php
session_start();
foreach ($_SESSION as $key=>$val)
echo "Key <b>".$key."</b> has the value of: <b>".$val."</b><br>"
?>
<!-- Print Session Variables END -->
What have I done wrong or omitted?
Bookmarks