sakiri Posted October 5, 2013 Share Posted October 5, 2013 (edited) 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 October 5, 2013 by sakiri (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted October 5, 2013 Share Posted October 5, 2013 Hi Sakiri, Edit file themes/<your theme folder>/modules/blocklayered/blocklayered.tpl Try to locate the following code (in 1.5.5.0 around line 53) and add the red code: {if $filter.format && $filter.type == 'price'} {displayPrice price=$filter.values[0]} - {displayPrice price=$filter.values[1]} {else} {$filter.values[0]|escape:html:'UTF-8'}{$filter.unit|escape:html:'UTF-8'} - {$filter.values[1]|escape:html:'UTF-8'}{$filter.unit|escape:html:'UTF-8'} {/if} This should do the trick pascal Link to comment Share on other sites More sharing options...
sakiri Posted October 5, 2013 Author Share Posted October 5, 2013 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 More sharing options...
PascalVG Posted October 5, 2013 Share Posted October 5, 2013 Hi Sakiri, Glad it worked for you :-) 1) maybe this helps. http://www.w3schools.com/php/php_operators.asp 2) no idea, probably function displayPrice doesn't add it... Let me check tonight 3) didn't tell them yet. Please do if you want. Cheers, Pascal Link to comment Share on other sites More sharing options...
sakiri Posted October 6, 2013 Author Share Posted October 6, 2013 Thank you for the link - I've bookmarked it. This one will help me a lot understanding and getting used to the php "dialect". Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now