2

Whenever I try to delete a tax rate, I get below error message.

Tax rate cannot be removed. It exists in tax rule

I checked there is no tax rule in admin. I have deleted all tax rules.

UPDATE

I have found some posts asking to delete data from tax_calulation table manually. Is it correct solution?

2

If you want to delete all Tax Rates then Just truncate tax_calculation_rate table via php my admin, Please keep backup of this table before perform this query.

1

You do not want to delete the table. This is not an error, but rather normal behavior. This is because the tax rate is being used. To be able to remove the tax rate:

  1. Go to: Admin > Sales > Tax > Manage Tax Rules.
  2. Find the rule that is using this tax rate.
  3. Either delete that rule, or change the tax rate that rule uses.
  4. Go aback to the Tax Rates and you will be able to delete it.
  • 1
    There are no rules at Admin > Sales > Tax > Manage Tax Rules. – piyush_systematix Mar 1 '16 at 9:17
0
function deleteTaxRate() {

try {

    foreach (Mage::getModel('tax/calculation_rate')->getcollection() as $rate) {
        echo 'Tax Rate Deleted : '.$rate->getId();
        $rate->delete();
    }
}
catch (Exception $e) {
    echo 'Delete tax rate failed '.PHP_EOL;
    echo $e->getMessage();
}}

Please use the above script.

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.