Search code examples
phpmagento-1.8

Can't set 0% tax rate


I'm using a fairly new Magento 1.8.0.0 installation, with no changes to the core. When trying to make a tax rate at 0%, Magento returns the following error upon save: Rate Percent should be a positive number.

Is this just a bug in Magento 1.8, keeping me from setting a tax rate with 0% tax, or am I missing something?


Solution

  • So it seems that this behavior (introduced in CE 1.8.0.0 - it works as expected in CE 1.7.0.2) will be removed.

    In the meantime you could try to rewrite app/code/core/Mage/Tax/Model/Calculation/Rate.php and remove these lines:

    if (!is_numeric($this->getRate()) || $this->getRate() <= 0) {
            Mage::throwException(Mage::helper('tax')->__('Rate Percent should be a positive number.'));
        }
    

    Instead you also could change the code to test for $this->getRate() < 0 instead of $this->getRate() <= 0.

    It's working.