0

I am trying to get tax rate for particular country for example for India I used following code but it returns 0

$taxClassId = $_product->getTaxClassId();
$country = 'IN';  
$TaxRequest  = new Varien_Object();
$TaxRequest->setCountryId( $country );  
$TaxRequest->setStore( Mage::app()->getStore() );
$TaxRequest->setCustomerClassId( $taxClassId );
$taxCalculationModel = Mage::getSingleton('tax/calculation');
$rate = $taxCalculationModel->getRate($TaxRequest);

1 Answer 1

0

First of all check if your taxes are set as they should and the rules are applied. During the checkout do you see the right taxes?

Then you can debug by looking at Mage_Tax_Model_Calculation::getRate(), first lines of code are:

        if (!$request->getCountryId() || !$request->getCustomerClassId() || !$request->getProductClassId()) {
            return 0;
        }

Then dig deeper if this is OK.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.