Jump to content

Layered Navigation module, wrong prices (missing tax)


D-Zs

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)
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 1 month later...

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)
Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

  • 5 years later...

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

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