For an US webshop, I need to remove taxes from a quote item for some customers. I can't use groups because there are in use for a loyalty program. I have added a customer attribute names "is_tax_exempt".
I have rewritten the following Model : Mage_Tax_Model_Sales_Total_Quote_Tax
In the _aggregateTaxPerRate() function I have modified the code like this :
$customer_id = Mage::getSingleton('customer/session')->getId();
$customer = Mage::getModel("customer/customer")->load($customer_id);
if($customer->getIsTaxExempt() == 1)
{
$item->setTaxAmount(0);
$item->setBaseTaxAmount(0);
}
else
{
$item->setTaxAmount(max(0, $rowTax));
$item->setBaseTaxAmount(max(0, $baseRowTax));
}
I have tested this code, it's working : tax_amount and base_tax_amount are setted to zero in the database.
My problem is : the price for the cart is wrong.
There is one item in the cart with price : 100$. The cart price is like :
Subtotal : $100.00
Grand Total Excl. Tax : $100.00
Tax : $6.50
Grand Total Incl. Tax : $106.50
I need to get Tax : 0 and Grand Total Incl/ tax : 0.
I have used the following configuration for tax parameters : http://www.magentocommerce.com/knowledge-base/entry/ce18-and-ee113-tax-config-us
How to do this ? Thank you in advance.