How To Hide Tax in OpenCart 1.5 Without Affecting Price

  • SumoMe

Do you want to hide the subtle Ex Tax value under your product prices in OpenCart but still want it calculated with the price? You might already know that you can hide the tax in the administration panel:

  1. Go to your store administration
  2. Go to System > Settings
  3. Click the Edit link that corresponds to your store
  4. Go to Option tab
  5. Click No in Display Prices With Tax field

Using this method, the tax value will indeed be hidden as well as in your product’s price calculation. The tax will only be calculated in the total of your shopping cart (VAT). But what if you still want the tax to be included in the price calculation of your product list and only hide the Ex Tax value under it?

It is very easy and as proof I will show you how to do this in two ways: (Under the assumption that you are using OpenCart’s default theme or a close modification of it)

1. Directly modifying your theme (not recommended)

Yes, I don’t recommend this but discussing how to do this will help you understand more how to do it in the second method.

You need only to open from your root directory the file catalog/view/theme/default/template/common/header.tpl and insert the following code before <?php echo $google_analytics; ?> in the <head> tag:

<style> .price-tax { display: none; } </style>

As you can see, it is only a matter of hiding the .price-tax class through CSS. No magic there.

2. Modifying your theme using vQmod (recommended)

In this method, you will do the same thing as the first one but with vQmod. If you are not familiar with vQmod I highly suggest that you start doing so especially if you are heavily modifying your OpenCart installation. Go to their website and be enlightened.

Here’s the code for the XML file of vQmod doing the same thing. You need only to change the theme directory (here it is default) depending on what you are using:

<modification>
	<id>Hide Tax</id>
	<version>1.5.x</version>
	<vqmver>1.0.8</vqmver>
	<author>maca</author>
	<!-- Start: Test: Hide Tax -->
	<file name="catalog/view/theme/default/template/common/header.tpl">
		<operation>
			<search position="before"><![CDATA[
				<?php echo $google_analytics; ?>
			]]></search>
			<add><![CDATA[
				<style> .price-tax { display: none; } </style>
			]]></add>
		</operation>
	</file>
</modification>

With this, you are done. Test the sh*t out of that product list and see the tax hide from fear. 😀

Let me know if you have any suggestions or violent reactions. D:

About maca

Hello, my name is Karlo Macariola. I once dreamed to be a painter or an animator but when I typed my first line of code I immediately fell in love with programming. Today my passions are with web development and web design though sometimes I still withdraw to my first love which is drawing. DeviantArt | Twitter | Facebook
This entry was posted in Web Development & Design and tagged , , . Bookmark the permalink.

11 Responses to How To Hide Tax in OpenCart 1.5 Without Affecting Price

  1. Vaibhav Jain1982 says:

    hey i want to hide ex tax but i wan to include “inc GST” word, also tell me how to calculate tax in nz. we have simple 15% GST in every product except some food. so for my site i need to add GST in every product and want to show “inc GST”..pls help..

    • maca says:

      Hi Vaibhav,

      You can directly modify your theme and add “inc GST” beside the price. The file is in catalog/view/theme/default/template/product.tpl. If you can use vQmod that’s better.

      You can assign the tax in each product in the Admin panel. But first you will have to define a Tax Classes and Geo Zones in System>Localization settings to assign them.

  2. Harry12 says:

    Thanks for that.

    You can also just add .price-tax { display: none; } to your CSS file.

    • maca says:

      Haha, yes that’s easier. I must be overthinking everything when I did that. 😀 Thanks Harry.

      If you’re serious about isolating mods though you can do the one above.

  3. bierman says:

    first option works like a charm

  4. Pingback: product Ex Tax removal | Open Cart Know How

  5. Nic says:

    Thanks a lot for the tip, this is exactly what i need 🙂 I’d like to do the “clean” vqmod-way, but i’m not sure what file to add the code you posted into. Can you help?

    • Nic says:

      Actually i just realized that i probably just need to create a new XML-file and pasting the code in there. Thanks anway! 🙂

  6. Senad says:

    Hey Maca,
    This may sound like a silly question, but is there a way to have prices showing as GST inclusive, with the amount that you have specified. For example, if you type $50 in a price box when creating a new product, can the price in the store be shown as $50 including tax, not $55?

    Cheers.

  7. Hi

    I am using OC 1.5.5.1 with OpenCart Mobile Framework PRO. I have removed the EX-GST from the full website but want to also remove it from the mobile site.

  8. Wasim says:

    Hello Sir,
    This is Wasim Akram From India and i want to know that how to Change the product Ex Tax below the product Price in OpenCart …Actually i want to replace the Tax into GST with product price …would you like to help me …………….Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *