Jump to content
D-Zs

Layered Navigation module, wrong prices (missing tax)

Recommended Posts

I have an issue with my Layered Navigation module when I want to filter by prices.

 

Im using prestashop 1.4.5.1 and the version of layered navigation is v1.8.6.

 

When I set up the price filter i see the prices correctly but the prices are without tax, which is a "no no" in Denmark. I have to show the prices with tax. I have ticked off the option saying "Use tax to filter price" with no change and also tried to untick the option with no change... what am I doing wrong?

 

My pricing setup for my products are as the following:

Product x

price before tax: xy

tax: +25%

Totalt price: xy+25%

 

Do I have to change my pricing so that the tax is already included in my initial pricing or what do I do?

 

Seeing as I have several hundreds of products in the catalog already, it would be a huge amount of work to change the prices.

Edited by D-Zs (see edit history)

Share this post


Link to post
Share on other sites

looks like I have the same problem, will look into it...

Have you figured something out?

Share this post


Link to post
Share on other sites

hi,

i've edited "blocklayered.php" so now only shows price with tax. far from perfect but it do the job.

 

 

'.(int)Tools::ps_round($max_price[$currency['id_currency']].',

to

'.(int)Tools::ps_round($max_price[$currency['id_currency']] * (100 + $max_tax_rate) / 100, 0).',

Edited by Bibi40k (see edit history)

Share this post


Link to post
Share on other sites

Hi !

I've the same problem !... the module filter products by prices (without taxes) even if i've checked the option 'use tax' in the BO ...

my "blocklayered.php" file is like Bibi40k's one (on line 1174) :

'.(int)Tools::ps_round($max_price[$currency['id_currency']] * (100 + $max_tax_rate) / 100, 0).')';

but it doesn't change anything ...

 

i'm on PS 1.4.8.3 ...

Share this post


Link to post
Share on other sites

IMPORTANT: This is a BRUTAL, temporary e desperate fix on prestashop 1.6.1.20:

Into file:

/public_html/modules/blocklayered/blocklayered.php

 

at row 1294 you can find:

 

          $values = array();

          foreach ($currency_list as $currency)

              $values[] = '('.(int)$id_product.',

                  '.(int)$currency['id_currency'].',

                  '.$id_shop.',

                  '.(int)$min_price[$currency['id_currency']].',

                  '.(int)Tools::ps_round($max_price[$currency['id_currency']] * (100 + $max_tax_rate) / 100, 0).')';

replace with:

         

          $max_tax_rate = 22; //in ITALY VAT is 22%, change it according to VAT in your country!!!!      

          $values = array();

          foreach ($currency_list as $currency)

              $values[] = '('.(int)$id_product.',

                  '.(int)$currency['id_currency'].',

                  '.$id_shop.',

                  '.(int)Tools::ps_round($min_price[$currency['id_currency']] * (100 + $max_tax_rate) / 100, 0).',

                  '.(int)Tools::ps_round($max_price[$currency['id_currency']] * (100 + $max_tax_rate) / 100, 0).')';

 

Rebuild price index... hope this help

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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