Post by michaelsen » Thu Mar 19, 2015 8:04 am

I need to make some of my customers tax exempt.
I was thinking about using the "safe" setting by renaming it to "Tax Exempt" and then make a query in the code to whether it's set to yes or no. If yes = don't calculate tax.

I'm looking at this code in tax.php as it seems to be where the tax is calculated, but I don't think I can use the customer id there.

Code: Select all

	public function calculate($value, $tax_class_id, $calculate = true) {
		if ($tax_class_id && $calculate) {
			$amount = 0;

			$tax_rates = $this->getRates($value, $tax_class_id);

			foreach ($tax_rates as $tax_rate) {
				if ($calculate != 'P' && $calculate != 'F') {
					$amount += $tax_rate['amount'];
				} elseif ($tax_rate['type'] == $calculate) {
					$amount += $tax_rate['amount'];

			return $value + $amount;
		} else {
			return $value;
Any suggestions how this can be done?

New member


Tue May 03, 2011 3:17 am
Who is online

Users browsing this forum: HAO and 40 guests