Magento Applying tax (VAT) twice

Magento Applying tax (VAT) twice

September 4, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Applying tax (VAT) twice

Understanding Tax Calculation Issues in Magento

You’re rightfully concerned about the tax calculation discrepancies you’ve encountered while working on your Magento site. Let me break down this complex issue to help you understand what’s going on behind the scenes and how to resolve it.

Anatomy of the Problem

The core of the problem lies in the way Magento handles catalog prices. You’ve correctly identified that when displaying product prices on category pages, the system seems to be applying tax twice—once at the database level and once during rendering.

Here’s a simplified explanation:

  1. Database Price Storage: Your SQL query successfully updated all product prices from inclusive to exclusive of tax.
  2. Tax Helper Function: The tax helper functions you’re using in your template (e.g., getPrice($_product, $_product->getPrice())) are supposed to return the correct price based on whether it’s inclusive or exclusive of tax.
  3. Rendering Issue: However, during rendering, Magento seems to be re-calculating the tax for some reason. This is evident from the line _finalPriceInclTax = $_taxHelper->getPrice($_product, $_product->getFinalPrice(), true) returning a price higher than expected.

Possible Causes and Solutions

Incorrect Tax Settings

Double-check your tax settings in the Magento admin panel:

  1. Store > Taxes > Tax Zones and Rates: Ensure you have the correct tax rate (20% VAT) set for the UK.
  2. Store > Configuration > Sales > Tax: Confirm that ‘Tax Calculation Method Based On’ is set to either “Row total” or “Total”.

Magento Core Bug

There might be a known issue in your version of Magento (1.7.0.2). To verify this:

  • Check the official Magento 1 Knowledge Base for any reported issues related to tax calculation.
  • If you suspect a core bug, consider upgrading to a newer version with more stable tax functionality.

Template Rendering Issue

Your template file (catalog/product/price.phtml) might have some logic that’s causing the double taxation:

  1. Inspect the Tax Helper Functions: Ensure that the tax helper functions are being used correctly and returning the expected values.
  2. Review the Price Output Logic: Double-check the if-else statement in your code snippet. The final price should ideally be the exclusive price (not inclusive).

Best Practices for Tax Management

To avoid such issues in the future, follow these best practices:

  1. Always use Magento’s built-in tax features and don’t attempt to override them unless necessary.
  2. Ensure consistency—either all prices are exclusive or all are inclusive of tax.
  3. Regularly update your Magento version to benefit from security patches and bug fixes.

Conclusion

In summary, the issue seems to be a combination of Magento’s complex pricing logic and potentially a rendering glitch in the template file or core functionality. To resolve this:

  1. Re-check your tax settings and ensure they’re consistent.
  2. If it persists, consider upgrading to a newer version of Magento.
  3. Contact the official Magento support or community forums for further assistance if needed.

Remember, Magento is a powerful e-commerce platform with many moving parts. While it offers great flexibility, these complexities can sometimes lead to unexpected behavior like this tax calculation issue. Always keep your system up-to-date and follow best practices for optimal performance.

For more detailed guides on tax management in Magento, visit our comprehensive blog at LaravelCompany.com.

Catalog Database Themes Admin

Our network