Jump to content

[SOLVED] Displaying tax included and tax excluded at same time.


Recommended Posts

Hello everyone :)

I've registered, beacuse I have a tiny problem with my shop. I would like to have both prices (tax incl. and tax excl.) shown. Just like THIS guy has. Somewhere in the options I have found, that I can set either tax excluded or included. Is there any way to change this ? If it is possible, than it would be nice if the tax excluded price was displayed with a bigger font. I'm using Presta Shop 1.3.1.1

Link to comment
Share on other sites

For example, change line 18 of product-list.tpl (in PrestaShop v1.3.1) from:

{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}



to:

{convertPrice price=$product.price} {l s='incl. tax'}

{convertPrice price=$product.price_tax_exc} {l s='excl. tax'}

Link to comment
Share on other sites

You can already do that using PrestaShop's translation tool. Just go to Tools > Translations, select "Front Office translations" in the dropdown, click language flag, then scroll down to the "product-list" section to change the text for "incl. tax" and "excl. tax" for that language.

Link to comment
Share on other sites

  • 5 weeks later...

Hello,
thank you very much for this! It really help me :)

But this is only in product-list.tpl. If I make this same in product.tpl, it isn't working. Please, Can you tell me what I have to edit in product.tpl to show prices with and without tax? Also please, what I must edit if I want to show excl. and incl. prices on Featured products on homepage?

Sorry for my bad english.

I have Version 1.3.2.3 on page www.test.atv-rakovnik.cz

Link to comment
Share on other sites

It is solved yet. I made this:

In product.tpl is this:

               {if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax incl.'}{/if}
               {/if}
               {if $priceDisplay == 1}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax excl.'}{/if}


edit on this:

               {if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax incl.'}{/if}
               {/if}

               {if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax excl.'}{/if}
               {/if} 



:)

Link to comment
Share on other sites

  • 2 weeks later...

This does not work if you have attributes that affects the price. Only the prechoosen pricestyle (with or without tax) gets updated, the other stays the same leaving a false price. At least for me with PS 1.3.2. Am I missing something?
Dwatte

Link to comment
Share on other sites

Your right. You will need to modify js/product.js in your theme's directory to make tax included and tax excluded displayed for combinations. The following code on lines 268-271 rewrites the prices:

$('#our_price_display').text(formatCurrency(priceProduct, currencyFormat, currencySign, currencyBlank));
$('#pretaxe_price_display').text(formatCurrency(productPricePretaxed, currencyFormat, currencySign, currencyBlank));
$('#old_price_display').text(formatCurrency(productPriceWithoutReduction2, currencyFormat, currencySign, currencyBlank));
$('#ecotax_price_display').text(formatCurrency(selectedCombination['ecotax'], currencyFormat, currencySign, currencyBlank));



You will need to add another line to rewrite both prices.

Link to comment
Share on other sites

This is how I did it. It seems to work with the attributes as well. Change the following code in product.tpl

               {if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax incl.'}{/if}
               {/if}
               {if $priceDisplay == 1}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax excl.'}{/if}
               {/if}

               {if $priceDisplay == 2}


{convertPrice price=$product->getPrice(false, $smarty.const.NULL)} {l s='tax excl.'}
               {/if}


to this:


{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax incl.'}{/if}

               {if $priceDisplay == 1}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax excl.'}{/if}
               {/if}




{convertPrice price=$product->getPrice(false, $smarty.const.NULL)} {l s='tax excl.'}



as in http://nordicase.com/shop (prelaunch website)

dwatte

Link to comment
Share on other sites

  • 3 months later...
This is how I did it. It seems to work with the attributes as well. Change the following code in product.tpl
               {if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax incl.'}{/if}
               {/if}
               {if $priceDisplay == 1}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax excl.'}{/if}
               {/if}

               {if $priceDisplay == 2}


{convertPrice price=$product->getPrice(false, $smarty.const.NULL)} {l s='tax excl.'}
               {/if}


to this:


{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax incl.'}{/if}

               {if $priceDisplay == 1}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax excl.'}{/if}
               {/if}




{convertPrice price=$product->getPrice(false, $smarty.const.NULL)} {l s='tax excl.'}



as in http://nordicase.com/shop (prelaunch website)

dwatte




Hi,

All code is fine for product and product-list
but I will have incl. tax and excl. tax on front page
how do i do then?

please see picture

SOLVED by my self.

38270_VUFt8BHoW7rpFF7LpLZv_t

Link to comment
Share on other sites

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

Hello everyone!

I'm back to the drawing board with this problem. I have updated my Prestashop to 1.4.1.0 and I have the same problem again. I've managed to show incl. and excl. in products, but I'm stuck with showing those on "featured products". Also the translation bit doesn't work anymore for me (or I have messed up something).

Cheers
K.

=====

yay! another solved one :) I've managed to get "price included, price excluded" in the "featured products" section, in a multilangual way.

I have edited the /modules/homefeatured/homefeatured.tpl file:
FROM:

                        {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}{else}



TO:




K.


                       {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
{if !$priceDisplay}
{convertPrice price=$product.price_tax_exc} {l s='tax excl.' mod='homefeatured'}
{convertPrice price=$product.price} {l s='tax incl.' mod='homefeatured'}{else}
{convertPrice price=$product.price_tax_exc}{/if}

{else}
Link to comment
Share on other sites

  • 4 weeks later...


{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}
{if $tax_enabled}{l s='tax incl.'}{/if}

{if $priceDisplay == 1}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}
{if $tax_enabled}{l s='tax excl.'}{/if}
{/if}



{convertPrice price=$product->getPrice(false, $smarty.const.NULL)} {l s='tax excl.'}



Hi, I did that and I have question.
How can I change price place. I need first price without tax and second price with tax.
Link to comment
Share on other sites


{convertPrice price=$product->getPrice(true, $smarty.const.NULL)} {if $tax_enabled}{l s=‘tax excl.’}{/if} {/if}  {if $priceDisplay == 1} {convertPrice price=$product->getPrice(false, $smarty.const.NULL)}{if $tax_enabled}{l s=‘tax incl.’}{/if}  {convertPrice price=$product->getPrice(false, $smarty.const.NULL)} {l s=‘tax excl.’}



Try this, hope it works. It's all about swapping the order of those two.

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