This is the blog for getting Idea regarding PHP, Magento, jQuery and JavaScript for Customization.

Wednesday 28 November 2012

Magento : Remove TAX / VAT from grand total in checkout


Here, We can Remove Tax from Grand Total.

If we want to removed tax for all customer we simply remove Tax class from the produc's then It will remove automatically.

But If you want to remove Tax for specific customer you can do using below steps.

Here Example for Remove Tax for that Customer Who have their Business VAT Numbers.

1) Goto " app/code/core/mage/tax/model/calculation.php  "

2) Find this Function "  public function getRateRequest() "

3) You can get this at the end of the function

    $request = new Varien_Object();
        $request
            ->setCountryId($address->getCountryId())
            ->setRegionId($address->getRegionId())
            ->setPostcode($address->getPostcode())
            ->setStore($store);
            ->setCustomerClassId($customerTaxClass);

4) Now Here for who have VAT/TAX numbers, no apply Tax in Grand Total

    $eutax = $customer['taxvat'];

    if($eutax != '')
   {
            //Who have to insert their VAT Number then remove TAX from Grand Total
            $request = new Varien_Object();
            $request
                       ->setCountryId($address->getCountryId())
                       ->setRegionId($address->getRegionId())
                       ->setPostcode($address->getPostcode())
                       ->setStore($store);                      
    }
    else
    {
           //Who have to not insertd their VAT Number then add TAX in Grand Total
           $request = new Varien_Object();
           $request
                      ->setCountryId($address->getCountryId())
                      ->setRegionId($address->getRegionId())
                      ->setPostcode($address->getPostcode())
                      ->setStore($store);
                      ->setCustomerClassId($customerTaxClass);


    }

5) Now check Tax is Remove from Grand Total in checkout.


1 comment:

  1. Hi,
    i used your code. To get taxvat value you should use :
    $quote= Mage::getSingleton('checkout/session')->getQuote();
    $eutax = $quote->getCustomerTaxvat();
    Regards
    filippo

    ReplyDelete