Jump to content

Layered navigation block>Product price filter working with price with tax


elenam

Recommended Posts

I use Prestashop 1.6.1.6 and have activated the module Layered navigation block. In it I have created a new template for my notebooks category and have activated the Product price filter.

 

The problem is that when I go on the frontend it filters the prices taking as initial range the price without tax, although I have made in all settings to show prices with tax.

 

Es. Product price filter shows as initial range the sum 15. 245 den that is the price without tax for Acer Apire and the price with tax is 17 990 МКД.

 

How I can set that the initial range in the filter is the price with tax (17 990 МКД)?

 

Thank you

post-1290731-0-60588300-1469028283_thumb.jpg

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

  • 2 months later...
  • 6 months later...
  • 1 month later...
  • 1 month later...

Bonjour,

 

ma solution provisoire en attendant de trouver mieux :

 

 

Modification de ./modules/blocklayered/blocklayered.php

 

Dans la fonction public static function indexProductPrices($id_product, $smart = true)

 

J'ai modifié :

 

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).')';

 

Par : $values = array(); foreach ($currency_list as $currency) $values[] = '('.(int)$id_product.', '.(int)$currency['id_currency'].', '.$id_shop.', '.(int)Tools::ps_round($max_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).')';

 

Ayant compris que les valeurs min correspondaient aux prix HT et les valeurs max aux prix TTC...

 

Si ça peut vous aider ;)

Link to comment
Share on other sites

Bonjour,

 

ma solution provisoire en attendant de trouver mieux :

 

 

Modification de ./modules/blocklayered/blocklayered.php

 

Dans la fonction public static function indexProductPrices($id_product, $smart = true)

 

J'ai modifié :

 

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).')';

 

Par : $values = array(); foreach ($currency_list as $currency) $values[] = '('.(int)$id_product.', '.(int)$currency['id_currency'].', '.$id_shop.', '.(int)Tools::ps_round($max_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).')';

 

Ayant compris que les valeurs min correspondaient aux prix HT et les valeurs max aux prix TTC...

 

Si ça peut vous aider ;)

Tested. Did not worked for me

Link to comment
Share on other sites

  • 1 month later...
  • 7 months later...
  • 3 months 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 your country VAT!!!!      

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