Need to creat Tax Exempt User Group who are NOT charged Sales Tax in E-Commerce checkout

Permalink
Posted in E-Commerce: https://www.concrete5.org/marketplace/addons/ecommerce/discussion/ne...

For those without access... here is the request:

I have created a group called "Tax Exempt" and I need exclude all sales tax charges for that group to be waived on all products (http://www.rockermanoftexas.com). I found a post from 2012 and I am not sure if it is still viable (http://www.concrete5.org/documentation/how-tos/developers/how-to-turn-off-sales-tax-by-user-group-in-ecommerce/). It suggest dropping the following code
$u = new User();
            $group = Group::getByName('taxexempt');
            if(is_object($group) && is_object($u)) {
                $taxexempt= $u->inGroup($group);
                if ($taxexempt) {
                    $doTax = false;
                }
            }


around line 172... but I have no idea if this is actually the correct place to insert the code.

I have attached the code below... can you please tell me if this is still a good solution and where exactly to drop the above code to affect the tax exempt feature?

<?php  
defined('C5_EXECUTE') or die(_("Access Denied."));
if(!function_exists('fnmatch')) {
    function fnmatch($pattern, $string) {
        return preg_match("#^".strtr(preg_quote($pattern, '#'), array('\*' => '.*', '\?' => '.', '\[' => '[', '\]' => ']'))."$#i", $string);
    } // end
}
class CoreCommerceSalesTaxRate extends Object {
   public function getSalesTaxRateID() {return $this->salesTaxRateID;}
   public function isSalesTaxRateEnabled() { return $this->salesTaxRateIsEnabled;}
   public function getSalesTaxRateName() {return $this->salesTaxRateName;}
   public function getSalesTaxRateStateProvince() {return $this->salesTaxRateStateProvince;}
   public function getSalesTaxRateCountry() {return $this->salesTaxRateCountry;}
   public function getSalesTaxRatePostalCode() {return $this->salesTaxRatePostalCode;}
   public function isSalesTaxIncludedInProduct() {return $this->salesTaxRateIncludedInProduct;}

barkingtuna