Jump to content
KubitDesign

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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Hi. Does any of the above need to be changed for 1.4.7.3? Thanks

Share this post


Link to post
Share on other sites

Does this work for 1.5.3.1 ?

 

Yes it does! only last {/if} you have to delete.

 

Martin

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Hi malcek.

 

Would you mind to clarify what {/if} I have to delete.

There is more than one at the end of all of the lines.

 

Kind regards

Weronicha

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
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.

 

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

 

Nick

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

{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)

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

hi everybody, 

 

why when i use the getPrice method in a php file i don't get the price but un object :s ? normaly getPrice return an float 

 

Prestashop 1.6

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

You can use module "Dual display of Tax included and Tax excluded prices" from addons for display product price with tax and without tax together.

Share this post


Link to post
Share on other sites
Hello guys, 

 

I am using prestashop 1.6.1.4

 

I wish I could see the percentage discount for each product at the top right of the image, instead of the word "new" or "sale"

 

I would appreciate your help, it is very important, thanks in advance

Share this post


Link to post
Share on other sites

Hi everyone!

I wonder if anybody knows how to display the tax rate next to words "VAT included", in product-list.tpl and in product.tpl too...

 

Many thanks for help

 

Giuliano

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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 --> 

Share this post


Link to post
Share on other sites

Hi all,

you can try this module  for display both prices, VAT included with VAT excluded prices together, for all products. Even you can set price display restrictions for customers groups, languages, etc.

Edited by cvikenzi (see edit history)

Share this post


Link to post
Share on other sites

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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More