sickshot Posted April 3, 2013 Share Posted April 3, 2013 (edited) hi i need to customize layered navigation filter, so when you move slider it shows weight rounded. in other words i want to remove decimals form weight slider. 1kg, 2 kg . 3 kg and so on and not like 1.45kg or something like this. any ideas how to do this? Edited April 24, 2013 by sickshot (see edit history) Link to comment Share on other sites More sharing options...
sickshot Posted April 4, 2013 Author Share Posted April 4, 2013 anyone can help with this? also if anyone knows how and where to change filter slider design? please help. Link to comment Share on other sites More sharing options...
Terragg Posted April 4, 2013 Share Posted April 4, 2013 (edited) Somewhere near line 156 in blocklayered.tpl ( PS v1.5.2 ) is the javascript where the size of the steps is determined for all the layered_slider filter types: var step = filterRange / 100; But any change there will affect all sliders, including price. You'll need to figure out / flag the weight slider from the other sliders and then have the template serve your customized javascript based on that. I haven't played with the Layered Nav. very much, but I hope this points you in the right direction... Good Luck, Edited April 4, 2013 by Terragg (see edit history) Link to comment Share on other sites More sharing options...
sickshot Posted April 4, 2013 Author Share Posted April 4, 2013 thank you for your reply. at least I know where to start Link to comment Share on other sites More sharing options...
sickshot Posted April 4, 2013 Author Share Posted April 4, 2013 is it possible to disable Gramms in general? that could solve my problem.... Link to comment Share on other sites More sharing options...
sickshot Posted April 5, 2013 Author Share Posted April 5, 2013 still no luck.... Link to comment Share on other sites More sharing options...
Terragg Posted April 5, 2013 Share Posted April 5, 2013 You might consider doing some 'adjustment math' to the filterRange variable in the lines before the place where steps is defined. That way you can be sure to get integer values as steps for the slider. Link to comment Share on other sites More sharing options...
sickshot Posted April 7, 2013 Author Share Posted April 7, 2013 still no success.. if anyone can help please... Link to comment Share on other sites More sharing options...
sickshot Posted April 13, 2013 Author Share Posted April 13, 2013 still no success.. if anyone can help please... Link to comment Share on other sites More sharing options...
PascalVG Posted April 13, 2013 Share Posted April 13, 2013 In general, you can add this piece of code to limit the decimals {printf("%.0f",$myVariableWithDecimals)} Didn't check where to put it in the blocklayered, but if you found the variable(s) already, try to wrap it/them with this code Hope this helps, Pascal 1 Link to comment Share on other sites More sharing options...
sickshot Posted April 13, 2013 Author Share Posted April 13, 2013 once again thank you Pascal!!! I'll check this and reply with results. Link to comment Share on other sites More sharing options...
sickshot Posted April 24, 2013 Author Share Posted April 24, 2013 Finality found a solution: i have edited /modules/blocklayered/blocklayered.php $weight_array = array( 'type_lite' => 'weight', 'type' => 'weight', 'id_key' => 0, 'name' => $this->l('Weight'), 'slider' => true, 'max' => '0', 'min' => null, 'values' => array ('1' => 0), 'format' => 5, // Ex: xxxxx kg 'filter_show_limit' => $filter['filter_show_limit'], 'filter_type' => $filter['filter_type'] ); and changed 'format' => 5, // Ex: xxxxx kg to 'format' => 1, // Ex: xxxxx kg thats all 1 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