Jump to content

Display product price with and without tax?


Recommended Posts

Hi All,

 

I wonder is someone could shed some light on this. I would like to display products prices BOTH with and without tax (or in my case VAT, which I have already adjusted in translations) so the product price shows like so:

 

Total ex. vat: £00.00

Total inc. vat £00.00

 

I have seem people talk about other workarounds adjusting the products.tpl, but these solutions have been used in earlier versions of prestashop and the code seems to have changed in my version of prestashop, and therefore I am struggling to find a solution. I am using prestashop version 1.4.4.0

 

Thank you in advance for any help!

Link to comment
Share on other sites

  • 1 month later...

Hi KubitDesign,

 

Not sure if you still need any help with this, but I just helped someone else with a similar request and the code change below works in PS 1.4.4.

 

For homefeatured:

Copy /modules/homefeatured/homefeatured.tpl to themes/your_theme/homefeatured/ (create the latter folder yourself) and change in copied homefeatured.tpl this (line 44):

  {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span></p>{else}<div style="height:21px;"></div>{/if}

in:

  {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{l s='tax excl.' mod='homefeatured'} {convertPrice price=$product.price_tax_exc}<br />{l s='tax incl.' mod='homefeatured'} {convertPrice price=$product.price}{/if}</span></p>{else}<div style="height:21px;"></div>{/if}

 

For product-lists:

Change in /themes/your_theme/product-list.tpl this (line 43):

 {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if}

in:

 {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{l s='tax excl.'} {convertPrice price=$product.price_tax_exc}<br />{l s='tax incl.'} {convertPrice price=$product.price}{/if}</span><br />{/if}

 

For product pages:

Change in /themes/your_theme/product.tpl this (lines 254-259):

 {if $priceDisplay >= 0 && $priceDisplay <= 2}
  <span id="our_price_display">{convertPrice price=$productPrice}</span>
   {if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
	{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
   {/if}
 {/if}

in:

 {if $priceDisplay >= 0 && $priceDisplay <= 2}
  <span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)}</span> {l s='tax excl.'}</span><br />
  <span id="our_price_display">{convertPrice price=$productPrice}</span>
   {if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
	{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
   {/if}
 {/if}

 

Change 'tax incl/tax excl' in whatever you prefer.

 

Hope this helps.

  • Like 6
Link to comment
Share on other sites

  • 6 months later...
  • 9 months later...

Another thing to change:

 

in product css find (around 218 line)

 

 

.our_price_display {

padding-bottom:10px;

font-weight:bold;

font-size:16px;

line-height:25px;

color:#9b0000

}

 

and after that add:

 

 

#pretaxe_price {

padding-bottom:10px;

font-weight:bold;

font-size:24px;

line-height:25px;

color:#9b0000

}

 

so you can have different size of prices

 

:D

 

Martin

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

I'm using 1.4.6.2 and this doesn't work for me with products that have attributes. It displays incorrect values for excl. and incl. tax. (ie. the excl. tax price is 20% lower than it should be, and the incl. tax price shows the excl. tax price.) Does anyone know how to fix that?

Link to comment
Share on other sites

Now I realise this is because I have set

 

Customers > Groups > Default > Price display method = Tax Excluded

 

so the $productPrice is without tax already, so putting _tax_exc after it will return the base price reduced by the tax rate.

 

 

So is there any way to display the price incl. tax, when the Price display method = Tax Excluded? I have chosen Tax Excluded because I want to itemise tax separately in the shopping cart and invoice, as I'm sure most B2B sellers will want to do.

Link to comment
Share on other sites

  • 3 months later...
  • 9 months later...

Hi,

still struggling with the pricing I manage to set the pricing on the productpage http://techkoop.nl/nl/sanitairkranen/161-doucheset-met-thermosstaatkraan.html

But This also needs to be on the homefeature page.

How can I display product price with and without tax on the homefeature page http://techkoop.nl/nl/47-hand-tools

 

I'm looking into file cshomefeature_itemshow.tpl

 

<div class="item_show">
<div class="image">
<a href="{$product.link|escape:'htmlall':'UTF-8'}" class="product_img_block_home" title="">
<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" alt=""/>
 
{if $product.specific_prices}
{if $product.specific_prices.reduction>0}
{if $product.specific_prices.reduction_type == 'percentage'}
<span class="on_sale">
<span class="percen">
-{$product.specific_prices.reduction*100}%
</span>
</span>
{else}
<span class="on_sale">
<span class="amount">
 
-{convertPrice price=$product.reduction}
</span>
</span>
{/if}
{/if}
{/if}
</a>
</div>
<div class="name_product">
<h3><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'|truncate:45:'...'}</a></h3>
</div>
<p class="product_desc">{$product.description_short|strip_tags:'UTF-8'|truncate:45:'...'}</p>
{if $product.ratting >0}
<div class="star_content clearfix">
{section name="i" start=0 loop=5 step=1}
{if $product.ratting le $smarty.section.i.index}
<div class="star"></div>
{else}
<div class="star star_on"></div>
{/if}
{/section}
</div>
{/if}
<div class="content_price">
{if $product.reduction}<span class="price old">{convertPrice price=$product.price_without_reduction}</span>{/if}
{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price{if $product.reduction}{/if}">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span>{/if}
</div>
 
</div>
Edited by WilkoHartung (see edit history)
Link to comment
Share on other sites

I also found the module for the quick view in the file csproduct.tpl I think I have to change this? to show both pricing..

 

{/if}
{if !$priceDisplay || $priceDisplay == 2}
{assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)}
{assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
{elseif $priceDisplay == 1}
{assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)}
{assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
{/if}
 
 
var productPriceWithoutReduction = '{$productPriceWithoutReduction}';
var productPrice = '{$productPrice}';
 
 
 
It's hard when your not a programmer  :mellow:
Edited by WilkoHartung (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Hi KubitDesign,

 

Not sure if you still need any help with this, but I just helped someone else with a similar request and the code change below works in PS 1.4.4.

 

For homefeatured:

Copy /modules/homefeatured/homefeatured.tpl to themes/your_theme/homefeatured/ (create the latter folder yourself) and change in copied homefeatured.tpl this (line 44):

	  {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span></p>{else}<div style="height:21px;"></div>{/if}
in:

	  {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{l s='tax excl.' mod='homefeatured'} {convertPrice price=$product.price_tax_exc}<br />{l s='tax incl.' mod='homefeatured'} {convertPrice price=$product.price}{/if}</span></p>{else}<div style="height:21px;"></div>{/if}
For product-lists:

Change in /themes/your_theme/product-list.tpl this (line 43):

	 {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if}
in:

	 {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{l s='tax excl.'} {convertPrice price=$product.price_tax_exc}<br />{l s='tax incl.'} {convertPrice price=$product.price}{/if}</span><br />{/if}
For product pages:

Change in /themes/your_theme/product.tpl this (lines 254-259):

	 {if $priceDisplay >= 0 && $priceDisplay <= 2}
	  <span id="our_price_display">{convertPrice price=$productPrice}</span>
	   {if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
		{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
	   {/if}
	 {/if}
in:

	 {if $priceDisplay >= 0 && $priceDisplay <= 2}
	  <span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)}</span> {l s='tax excl.'}</span><br />
	  <span id="our_price_display">{convertPrice price=$productPrice}</span>
	   {if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
		{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
	   {/if}
	 {/if}
Change 'tax incl/tax excl' in whatever you prefer.

 

Hope this helps.

 

 

We have almost three years later but Your solution for product-list (used in homefeatured too!) works like a charm with 1.5.6.2

Thanks :)

Link to comment
Share on other sites

  • 2 months later...

Now I realise this is because I have set

 

Customers > Groups > Default > Price display method = Tax Excluded

 

so the $productPrice is without tax already, so putting _tax_exc after it will return the base price reduced by the tax rate.

 

 

So is there any way to display the price incl. tax, when the Price display method = Tax Excluded? I have chosen Tax Excluded because I want to itemise tax separately in the shopping cart and invoice, as I'm sure most B2B sellers will want to do.

 

BUMP... anyone got a solution to the above ?

 

Nick

Link to comment
Share on other sites

  • 4 months later...

BUMP... anyone got a solution to the above ?

 

Nick

 

This is really important now, as google will suspend merchant center product listings that don't show prices including tax on the landing page.

 

How can we display the price incl. tax, when the Price display method = Tax Excluded? Please!

Link to comment
Share on other sites

  • 2 weeks later...

{convertPrice price=$productPrice*1.2}

 

I came up with this dirty fix, obviously I have to remember to update the code if the tax rate changes, but it at least it works for products without attributes.

 

But for products with attributes, this price does not update when another attribute is selected.

 

How can I make this price update when an attribute is selected? Anybody?

 

Thanks for any suggestions!

Edited by mowax (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Hello,

 

Thanks for your post. It works very well. However I have a problem, if a customer registered with VAT number, their cart will display Zero VAT!! This only happens with customer with VAT number which is a required field in customer registration process. Could you please let me know how to fix this??

 

Thank you very much for your help.

 

 

Hi KubitDesign,

Not sure if you still need any help with this, but I just helped someone else with a similar request and the code change below works in PS 1.4.4.

For homefeatured:
Copy /modules/homefeatured/homefeatured.tpl to themes/your_theme/homefeatured/ (create the latter folder yourself) and change in copied homefeatured.tpl this (line 44):

     {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span></p>{else}<div style="height:21px;"></div>{/if}
in:
     {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{l s='tax excl.' mod='homefeatured'} {convertPrice price=$product.price_tax_exc}<br />{l s='tax incl.' mod='homefeatured'} {convertPrice price=$product.price}{/if}</span></p>{else}<div style="height:21px;"></div>{/if}

For product-lists:
Change in /themes/your_theme/product-list.tpl this (line 43):
     {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if}
in:
     {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{l s='tax excl.'} {convertPrice price=$product.price_tax_exc}<br />{l s='tax incl.'} {convertPrice price=$product.price}{/if}</span><br />{/if}

For product pages:
Change in /themes/your_theme/product.tpl this (lines 254-259):
     {if $priceDisplay >= 0 && $priceDisplay <= 2}
     <span id="our_price_display">{convertPrice price=$productPrice}</span>
     {if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
        {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
     {/if}
     {/if}
in:
     {if $priceDisplay >= 0 && $priceDisplay <= 2}
     <span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)}</span> {l s='tax excl.'}</span><br />
     <span id="our_price_display">{convertPrice price=$productPrice}</span>
     {if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
        {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
     {/if}
     {/if}

Change 'tax incl/tax excl' in whatever you prefer.

Hope this helps.

 

Edited by vmthang (see edit history)
Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...
  • 2 weeks later...

I too need to display both inc and ex tax prices. I have managed to get both showing on the product page, but when selection a product with options and a price differential the inc tax calculation does not update on the page - giving the wrong inc Tax figure!

 

Google now tell me that Shopping Ads will be suspended unless I display prices inc Tax. Despite main business being B2B and thus need to display to majority of customers Ex Tax!

 

Has anyone an answer on how to get both prices displayed correctly in v1.6?

 

Thanks

Baz

Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...
  • 1 month later...
  • 1 month later...

Hi everyone!

 

I am trying to achieve the same thing, but on different version of prestashop.

How does it work for prestashop 1.6.1.3 cloud?

Can I use the same code, I actually tried to find the suggested lines, but without any luck.

Is there anyone who could guide me through on this?

Thanks in advance

Link to comment
Share on other sites

Hi everone

 

I have prestashop 1.6.1.3 cloud

Can anyone tell me on which lines can I find the the code what I have to change if the above mentioned works with my version of prestashop?

Thank you in advance

Link to comment
Share on other sites

  • 6 months later...

Hi there!

 

It seems it is a dead topic, but i have to find a solution.

 

We use PS 1.6.1.4. and a leo theme.

 

If anybody read it, Who know, What I have to modify in the code above mentioned for show the VAT % after the price excluded, just put it there.

 

THANK YOU!

 

Lazlo

Edited by szilaszlo (see edit history)
Link to comment
Share on other sites

  • 8 months later...

Hi there!

 

It seems it is a dead topic, but i have to find a solution.

 

We use PS 1.6.1.4. and a leo theme.

 

If anybody read it, Who know, What I have to modify in the code above mentioned for show the VAT % after the price excluded, just put it there.

 

THANK YOU!

 

Lazlo

Hi :)

 

I've found a solution for your problem. It has just one problem: if you have any product's attributes which can change the price value (example: Custom color YES (+ 200 USD) NO (+ 0 USD) , then only the price with tax included gonna change, if you select that attribute. 

<!-- prices -->
                     <div class="price">
                        <p class="our_price_display" style="line-height: 0.6;" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                           {if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if}
                           {if $priceDisplay >= 0 && $priceDisplay <= 2}
                              <span id="our_price_display" >{convertPrice price=$productPrice}</span>
                              {if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) || !isset($display_tax_label))}
                                 {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s=''}{/if}
                              {/if}
                              <meta itemprop="priceCurrency" content="{$currency->iso_code}" />
                           {/if}
                        </p>
                                </br><p class="our_price_display" style="line-height: 0.6;" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                        
                              <span id="pretaxe_price" style="font-weight: 300; font-size: 12px; color: #000000;">
                              <span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>
                              <span style="font-size: 10px;  color: black;">{l s='bez DPH'}</span>
                           </span>
                        </p>
                        <p id="reduction_percent" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}>
                           <span id="reduction_percent_display">
                              {if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}
                           </span>
                        </p>
                        <p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 0} class="hidden"{/if}>
                           {if $priceDisplay >= 0 && $priceDisplay <= 2}
                              <span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span>
                              {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if}
                           {/if}
                        </p>
                        {if $priceDisplay == 2}
                           <br />
                           <span id="pretaxe_price">
                              <span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>
                              {l s='tax excl.'}
                           </span>
                        {/if}
                     </div> <!-- end prices --> 
Link to comment
Share on other sites

  • 10 months later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...