<p>OK So I figured this one out eventually. It's a very hacky fix. I added an <a href="https://craftcommerce.com/docs/adjusters" rel="nofollow noreferrer">adjuster</a> that is basically an exact copy of the built-in Tax Adjuster (found at <code>plugins/commerce/Commerce/Adjusters/Commerce_TaxAdjuster.php</code>). The only difference is that I added a condition to check for my Tax Exempt field (and that we're in the OH tax zone), and then <em>removed</em> the tax amount instead of added it.</p>

<p>ie, I changed things like </p>

<pre><code>$allRemovedTax += $amount;
$item-&gt;tax += $amount;
</code></pre>

<p>to</p>

<pre><code>$allRemovedTax -= $amount;
$item-&gt;tax -= $amount;
</code></pre>

<p>And then added the whole thing to a new custom plugin.</p>

<p>What this results in is tax being applied normally, and then the same tax being removed. </p>

<p><img src="https://cl.ly/01183O2x1f17/Screen%20Shot%202016-06-15%20at%202.05.28%20PM.png" alt=" "></p>

<p>If anybody comes across this and has a better solution, I'd love to hear it. But this works for now.</p>

CC BY-SA 3.0
2016-10-27T16:26:01.753Z
That alone did not work for me, I needed to modify optionsJson array like this: `        $taxRateAttributes = $taxRate->attributes;`
`        $taxRateAttributes["name"] .= " Excempt";`
`        $taxRateAttributes["rate"] = -$taxRateAttributes["rate"];`
`        $adjustment->optionsJson = $taxRateAttributes;`
Yuri Salimovskiy
CC BY-SA 3.0
2016-06-15T18:06:38.093Z
2016-06-15T18:06:38.093Z
2017-03-10T09:42:49.823Z
Dan Ott
<p>Many of the customers we'll be selling to are tax-exempt entities. We're located in OH, so for OH customers we're applying sales tax through the Tax Zone setup in Commerce. Is there a way to not apply the tax based on some conditional, even though their billing address is in OH?</p>

<plugin-craftcommerce>
Conditionally apply a tax zone in commerce
# Conditionally apply a tax zone in commerce

(Asked by: username_0 on 2016-06-02)

Many of the customers we'll be selling to are tax-exempt entities. We're located in OH, so for OH customers we're applying sales tax through the Tax Zone setup in Commerce. Is there a way to not apply the tax based on some conditional, even though their billing address is in OH?

**Tags:** plugin-craftcommerce

---

## 1 answers

### Answer by username_0 on 2016-06-15. Score: 4

OK So I figured this one out eventually. It's a very hacky fix. I added an adjuster that is basically an exact copy of the built-in Tax Adjuster (found at plugins/commerce/Commerce/Adjusters/Commerce_TaxAdjuster.php). The only difference is that I added a condition to check for my Tax Exempt field (and that we're in the OH tax zone), and then removed the tax amount instead of added it.
ie, I changed things like 
$allRemovedTax += $amount;
$item->tax += $amount;

to
$allRemovedTax -= $amount;
$item->tax -= $amount;

And then added the whole thing to a new custom plugin.
What this results in is tax being applied normally, and then the same tax being removed. 

If anybody comes across this and has a better solution, I'd love to hear it. But this works for now.

> **Comments:**
> **username_1**: That alone did not work for me, I needed to modify optionsJson array like this: `        $taxRateAttributes = $taxRate->attributes;` `        $taxRateAttributes["name"] .= " Excempt";` `        $taxRateAttributes["rate"] = -$taxRateAttributes["rate"];` `        $adjustment->optionsJson = $taxRateAttributes;`  

---

