dtgmaze Posted July 1, 2017 Share Posted July 1, 2017 Hi, Filters are not working correctly. When I filter on Brand it's not working correct http://www.loveforrain.nl/26-regenjas#/merken-rains try the link >> this filter does not work (brand) when I filter on everything else no problem. http://www.loveforrain.nl/26-regenjas#/kleur-geel try the link >> this filter works this is very anoying when users make a filter selection, and then go back to category view. Then they loose the Filtered options. Grtz, Dennis 1 Link to comment Share on other sites More sharing options...
NemoPS Posted July 2, 2017 Share Posted July 2, 2017 It's a core bug. It's not supposed to recognize anything apart from "manufacturer" in the code.So what you need to do is find the piece of broken code and add a condition like if the name is merken, it will rename it manufacturer for that bit of code.Sadly, I can't recall the right spot off the top of my head, but it's in blocklayered.php, somewhere around getFilteredProducts Link to comment Share on other sites More sharing options...
dtgmaze Posted July 3, 2017 Author Share Posted July 3, 2017 Hi, I have checked the for "getFilteredProducts" in blocklayered.php, but cannot find it. As I must say I am not "Hero" at all as it becomes to coding. More help is appreciated! Link to comment Share on other sites More sharing options...
dtgmaze Posted July 6, 2017 Author Share Posted July 6, 2017 Anyone ? Need help with this Link to comment Share on other sites More sharing options...
Scully Posted July 6, 2017 Share Posted July 6, 2017 If you are not a hero in coding, leave it as it is. The program code for these filters is among the most complex program code I have read in prestashop. And I have seen a lot. Link to comment Share on other sites More sharing options...
dtgmaze Posted July 7, 2017 Author Share Posted July 7, 2017 It's a shame it doesn't work as supposed. Thnx for the advice! 1 Link to comment Share on other sites More sharing options...
NemoPS Posted July 15, 2017 Share Posted July 15, 2017 I agree with Scully, it's been very hard for me to do it when I did, and it was in any case still not perfect Link to comment Share on other sites More sharing options...
DutchPresta Posted October 29, 2018 Share Posted October 29, 2018 (edited) Dont know if you still need help, open blocklayered.php. Find line around line 1729: $selected_filters[$attribute_name] = array($this->filterVar($url_parameters[0]), $this->filterVar($url_parameters[1])); Add after this line another else if: else if ($attribute_name == 'merk') { $merk = str_replace("_", " ", $url_parameters[0]); $merk2 = str_replace("_", "-", $url_parameters[0]); $manufacturers = Db::getInstance()->executeS('select id_manufacturer from ps_manufacturer where name = "'.$merk.'"'); if(!empty($manufacturers)) { $selected_filters['manufacturer'] = array($manufacturers[0]['id_manufacturer']); } else { $manufacturers = Db::getInstance()->executeS('select id_manufacturer from ps_manufacturer where name = "'.$merk2.'"'); if(!empty($manufacturers)) { $selected_filters['manufacturer'] = array($manufacturers[0]['id_manufacturer']); } } } NOTE: replace "merk" in my code with "merken" for your code to work. Now it should work! Edited October 29, 2018 by DutchPresta (see edit history) 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