Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Tax Exempt by Customer Group

Tax Exempt by Customer Group

Views: 4,786

Results 1 to 4 of 4
29 Jun 2012, 9:19 PM
#1
lunabug avatar

lunabug

New Zenner

Join Date:
Dec 2009
Posts:
94
Plugin Contributions:
0

Tax Exempt by Customer Group

I found this thread http://www.zen-cart.com/showthread.php?115212-Tax-Exempt-by-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

 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

  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:

<!-- 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?

4 Jul 2012, 2:40 AM
#2
lunabug avatar

lunabug

New Zenner

Join Date:
Dec 2009
Posts:
94
Plugin Contributions:
0

Re: Tax Exempt by Customer Group

Anybody!?!?

9 Jul 2012, 4:21 AM
#3
lunabug avatar

lunabug

New Zenner

Join Date:
Dec 2009
Posts:
94
Plugin Contributions:
0

Re: Tax Exempt by Customer Group

Isn't there anybody out there that can help me with this?