Jump to content

[SOLVED] Layered Navigation: Weight formatted as Currency in Enabled Filters overview


Recommended Posts

Hi everybody,


I stumbled upon a rather funny bug in the Layered Navigation Block (FO display): I'm using the "weight" value in my layered navigation. In the overview of available filters the values are displayed correctly (that is, just the "naked" value without decimal places).

But as soon as the weight-filter is applied, in the Enabled Filters overview above the sliders the values appear formatted as currency (with two decimal places, separator plus the currency sign)! (see screenshot in attachment).


Has somebody an idea where and how to fix this?


Thank you!



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

Hi Sakiri,


Edit file themes/<your theme folder>/modules/blocklayered/blocklayered.tpl

Try to locate the following code (in around line 53) and add the red code:


{if $filter.format && $filter.type == 'price'}
 {displayPrice price=$filter.values[0]} - 
 {displayPrice price=$filter.values[1]}
 {$filter.values[0]|escape:html:'UTF-8'}{$filter.unit|escape:html:'UTF-8'} - 
This should do the trick
Link to comment
Share on other sites

This should do the trick


And so it does! Thank you! :) Runs like a charm!


Three more questions if I may:

1 - As you already might have suspected  ;)  I'm still pretty wet behind the ears when it comes to php and all the other scripting languages used in the Prestashop framework; my knowledge of VBA and SAP/ABAP does not help too much here... But I want to learn and understand what I'm doing. So could you please explain to me in a few words what these && and == (and in other places I found ===) do?

2 - Do you have a clue why in the Layered Navigation block there is no space between the currency sign and the amount value? This is the only spot in the whole FO display (as far as I could see so far) where the BO-settings for currencies to add a blank between sign and value don't get pulled.

3 - Should I / May I submit your above solution / bug fix to the issue tracker? Or did you do so already?

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