Magento: showing prices ex/inc TAX/VAT depending on customer group

Magento: showing prices ex/inc TAX/VAT depending on customer group

July 16, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento: showing prices ex/inc TAX/VAT depending on customer group

Showing Prices Ex/Inc Tax/VAT Depending on Customer Group in Magento

As an experienced developer, I understand your requirement of displaying prices both including and excluding tax for specific customer groups while keeping the billing process unchanged. This functionality can be achieved without creating a new storefront by making some adjustments to your existing setup.

Understanding the Current Setup

In your current implementation, you have a ‘trade only’ storefront that shows both in-VAT and ex-VAT prices for trade customers. The catalog displays prices including VAT, but the billing process still charges the regular inc-VAT price. You want to extend this functionality to other customer groups without creating separate storefronts.

Challenges and Limitations

Before proceeding with the solution, it’s important to address some potential challenges:

  1. Magento’s pricing logic is tightly integrated with tax calculation and cannot be easily overridden for specific customer groups.

  2. Modifying the core files directly can lead to compatibility issues with future updates or other extensions.

  3. Displaying both in-VAT and ex-VAT prices requires additional information to be stored and displayed accurately.

Proposed Solution

To implement this functionality, we will create a custom module that extends Magento’s tax configuration and price display logic. Here is an outline of the steps involved:

  1. Create a new module using the Magento extension builder or by following the official documentation: https://developer.adobe.com/commerce/contributor/guide/magento-core/module-builder/

  2. Override the tax/config file with your custom tax configuration. This allows you to define custom tax rates and rules specific to certain customer groups.

  3. Create a new price display type in your module’s etc/config.xml file. For example:

<config>
    <global>
        <tax>
            <price_display_type>
                <value>both</value>
                <label>Both IN/EX Tax</label>
            </price_display_type>
        </tax>
    </global>
</config>
  1. In your module, override the tax/model/config.php file to modify the price display type based on the customer group.

  2. Add conditional logic in your custom getPriceDisplayType() function to change the price display type for specific customer groups:

public function getPriceDisplayType($store = null)
{
    $customer = Mage::helper('customer')->getCustomer();
    if ($customer->getGroupId() > 1) {
        return self::DISPLAY_TYPE_BOTH;
    } else {
        return (int)Mage::getStoreConfig(self::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE, $store);
    }
}
  1. Update your theme’s template files to handle the custom price display labels and formatting for both in-VAT and ex-VAT prices.

Implementation Steps

To implement this solution, follow these steps:

  1. Create a new module folder structure under app/code/local/Mage/Tax/.

  2. Copy the tax/model/config.php file from the core Magento directory to your new module’s model directory (app/code/local/Mage/Tax/Model/).

  3. Open the config.php file and update the getPriceDisplayType() function as shown in step 5 above.

  4. Save the changes and clear the cache using the command php bin/magento cache:clean.

Conclusion

By following this approach, you can display prices including and excluding tax for specific customer groups without creating separate storefronts. This solution allows you to maintain a single catalog with customized pricing logic based on the customer’s group.

Remember that modifying core files directly should be avoided whenever possible. Consider using an extension builder or consulting with an experienced Magento developer to ensure the stability and long-term maintainability of your custom implementation.

Don’t forget to explore the extensive resources available at LaravelCompany for more advanced Magento development techniques and best practices.

Let’s connect on LinkedIn to discuss further enhancements or any other Magento-related questions you may have.

Catalog Extensions Configuration Customers

Our network