mlarino Posted May 26, 2015 Share Posted May 26, 2015 One of the problems of the manufacturers list page, is that it showcases all the products of that manufacturer with no way to filter them or select to only display the ones that match a criteria. I have a fashion shop, and need a way to separate from "Men" "Women" "Kids" clothing, inside manufacturer pages. Any ideas how can I do this? Thanks! Link to comment Share on other sites More sharing options...
mlarino Posted June 2, 2015 Author Share Posted June 2, 2015 No solution for this? Link to comment Share on other sites More sharing options...
vekia Posted June 3, 2015 Share Posted June 3, 2015 hello i checked your page i see there some filter at the moment Link to comment Share on other sites More sharing options...
mlarino Posted June 6, 2015 Author Share Posted June 6, 2015 hello i checked your page i see there some filter at the moment Hi Vekia, Thanks for the reply, No, that is the reference website, I wold like to create a filter like that in manufacturer pages, were I can choose to show women or men shoes. Link to comment Share on other sites More sharing options...
mlarino Posted June 11, 2015 Author Share Posted June 11, 2015 No idea how to do this? Not sure how is it possible to filter products in the manufacturer page so the user doenst have all products mixed (men and woman). That link I shared is from a reference website that was able to do it. and was wondering how can I accomplish the same thing. Thanks! Link to comment Share on other sites More sharing options...
dj060004 Posted June 11, 2015 Share Posted June 11, 2015 (edited) Hi, As you saw, I originally posted here about this. I wasn't able to find a module that did what I needed so wrote one myself (actually modified blockmanufacture). What I was hoping to do was as follows: I wanted a "sticky" manufacture filter - that is to say when a manufacture was selected, all other navigation would filter by that manufacture until it was explicitly cleared. I changed the home hook code in BM to set a cookie for the current manufacture. Something like public function hookHeader($params) { $id_manufacturer = Tools::getValue('id_manufacturer'); if($id_manufacturer !== false) { $this->context->cookie->id_manufacturer = (int)$id_manufacturer; } else { $page_name = Dispatcher::getInstance()->getController(); if( $page_name != 'category' && $page_name != 'product') { unset($this->context->cookie->id_manufacturer); } } if( !empty( $this->context->cookie->id_manufacturer ) ) { $id_manufacturer = $this->context->cookie->id_manufacturer; $this->displayed_manf = new Manufacturer( $id_manufacturer, $this->context->cookie->id_lang ); $this->context->smarty->assign( 'displayed_manuf', $this->displayed_manf ); } $this->context->controller->addCSS(($this->_path).'blockmanufacturer.css', 'all'); } This sets a cookie when user navigates to the manufacture pages and then unsets it when ever they navigate to any page other than the product pages. Then created a new template that was hooked into the center column hook that simply displays a box with what manufacture was selected <div id="manufacturers_block_clear" class="col-xs-12"> You are currently viewing products by brand {$displayed_manuf->name}. If you wish to clear this filter, click <a href="/" rel="nofollow">here</a>. </div> <div class="clearfix"></div> Then i made some changes to blockcategories to only show the categories that contained products from the selected brands. // around line 195 in blockcategoies.php $id_manufacturer = $this->context->cookie->id_manufacturer; $name = $category ? $category->id : null; if(!empty($id_manufacturer)) { $name .= "|" . $id_manufacturer; } // then around line 225 INNER JOIN `'._DB_PREFIX_.'category_shop` cs ON (cs.`id_category` = c.`id_category` AND cs.`id_shop` = '.(int)$this->context->shop->id.')'; $m = null; if( !empty( $id_manufacturer ) ) { $sql .= ' INNER JOIN `ps_category_product` cp ON (c.`id_category` = cp.`id_category`) INNER JOIN `ps_product` p ON (cp.`id_product` = p.`id_product` AND ( cp.`id_category` = 1 OR p.`id_manufacturer` = ' . $id_manufacturer . '))'; $m = new Manufacturer( $id_manufacturer, $this->context->cookie->id_lang ); } Then what I was hoping to be able to do was use the actionProductListModifier hook to strip out products that didn't match the selected manufacture... But thats where it started to go wrong because I could not get pagination working correctly. The products were stripped out, but the page count still showed the total number of products as would have been shown without the filter enabled. So in the end, I had to resort to modding the core code. I modded Category.getProducts to take an id for manufacturer public function getProducts($id_lang, $p, $n, $order_by = null, $order_way = null, $get_total = false, $active = true, $random = false, $random_number_products = 1, $check_access = true, Context $context = null, $id_manuf = null) // around line 667 if(!empty($id_manuf)) { $sql .= ' AND p.id_manufacturer = '.(int)$id_manuf; } // around line 707 if(!empty($id_manuf)) { $sql .= ' AND p.id_manufacturer = '.(int)$id_manuf; } $sql .= ' GROUP BY product_shop.id_product'; Then changed every call to getProducts to pass in the cookie value. And for me, it works. But its a great big hack which is why wouldn't want to publish it as an actual module etc. Looking at the site you posted, its clear they have done the same. I suspect they have modded ManufactureController to take an extra query string option that determines the category. The modded the core getProducts function for class Manufacture to take this into account. Manufacture's I think are a bit of an after thought in PS. The out of the box implementation is pretty useless since I can't see any user wanting to see a FULL list of products by manufacture, unless you only have a few. The layered navigation filters go someway to sorting this out, but the navigation is still category "centric". For my hack above, I have had to live without the layered navigation manufacture filter which is a shame, but the industry my shop is in is very much about people shopping by brand, so this is what I had to do. If you ever find anything better, do post here. Edited June 11, 2015 by dj060004 (see edit history) Link to comment Share on other sites More sharing options...
Boob Posted June 12, 2019 Share Posted June 12, 2019 Hi, i need a category filter and all filter in a manufacter or brand page. I have PS 1.7.5.2 It's possible? Link to comment Share on other sites More sharing options...
lalitjaa Posted March 26, 2021 Share Posted March 26, 2021 Hi, i need a category filter and all filter in a manufacter or brand page. I have PS 1.7.5.2 Link to comment Share on other sites More sharing options...
Quentin Fahrner Posted April 23, 2021 Share Posted April 23, 2021 Hi, same needs here. I need filters on manufacter or brand page. I have PS 1.7.7.2 Link to comment Share on other sites More sharing options...
HairMaker.Gr Posted September 24, 2021 Share Posted September 24, 2021 Hi there Same and for me I need filter into the brand pages. Link to comment Share on other sites More sharing options...
bazweb Posted October 12, 2021 Share Posted October 12, 2021 Same problem! I need to add filters in brand pages. I think it's really odd that prestashop cannot add this basic functionality. I cannot even find a paying module that works with 1.7.7.x or greater. Any ideas? 1 Link to comment Share on other sites More sharing options...
Quentin Fahrner Posted November 5, 2021 Share Posted November 5, 2021 Hi there, we used the module "Advanced Search 4" which offers this feature : https://addons.prestashop.com/fr/recherches-filtres/2778-advanced-search-4-recherche-par-filtre-tri-par-filter.html#overview. (I am not related to the module development company). It's a bit expensive but the job is done. I'm still really surprised Prestashop does not offer that in it's core. Link to comment Share on other sites More sharing options...
w3bsolutions Posted December 27, 2021 Share Posted December 27, 2021 Hi, I have implemented a module for category filters (at the moment only categories) on the brand pages, see here or here, for PS 1.7. The module works in a similar fashion and same styles than the default faceted search module, meaning you initially see the first level categories and you can drill down to the last category. Filtering by a category includes products from its subcategories. When you enter a subcategory, it is added to the breadcrumb so you can go back up to parent categories. I plan to add more filters (price range, features, etc) in the future. If anybody is interested PM me. 2 Link to comment Share on other sites More sharing options...
kleipin Posted December 31, 2021 Share Posted December 31, 2021 (edited) On 6/11/2015 at 11:34 PM, dj060004 said: Hi, As you saw, I originally posted here about this. I wasn't able to find a module that did what I needed so wrote one myself (actually modified blockmanufacture). What I was hoping to do was as follows: I wanted a "sticky" manufacture filter - that is to say when a manufacture was selected, all other navigation would filter by that manufacture until it was explicitly cleared. I changed the home hook code in BM to set a cookie for the current manufacture. Something like public function hookHeader($params) { $id_manufacturer = Tools::getValue('id_manufacturer'); if($id_manufacturer !== false) { $this->context->cookie->id_manufacturer = (int)$id_manufacturer; } else { $page_name = Dispatcher::getInstance()->getController(); if( $page_name != 'category' && $page_name != 'product') { unset($this->context->cookie->id_manufacturer); } } if( !empty( $this->context->cookie->id_manufacturer ) ) { $id_manufacturer = $this->context->cookie->id_manufacturer; $this->displayed_manf = new Manufacturer( $id_manufacturer, $this->context->cookie->id_lang ); $this->context->smarty->assign( 'displayed_manuf', $this->displayed_manf ); } $this->context->controller->addCSS(($this->_path).'blockmanufacturer.css', 'all'); } This sets a cookie when user navigates to the manufacture pages and then unsets it when ever they navigate to any page other than the product pages. Then created a new template that was hooked into the center column hook that simply displays a box with what manufacture was selected <div id="manufacturers_block_clear" class="col-xs-12"> You are currently viewing products by brand {$displayed_manuf->name}. If you wish to clear this filter, click <a href="/" rel="nofollow">here</a>. </div> <div class="clearfix"></div> Then i made some changes to blockcategories to only show the categories that contained products from the selected brands. // around line 195 in blockcategoies.php $id_manufacturer = $this->context->cookie->id_manufacturer; $name = $category ? $category->id : null; if(!empty($id_manufacturer)) { $name .= "|" . $id_manufacturer; } // then around line 225 INNER JOIN `'._DB_PREFIX_.'category_shop` cs ON (cs.`id_category` = c.`id_category` AND cs.`id_shop` = '.(int)$this->context->shop->id.')'; $m = null; if( !empty( $id_manufacturer ) ) { $sql .= ' INNER JOIN `ps_category_product` cp ON (c.`id_category` = cp.`id_category`) INNER JOIN `ps_product` p ON (cp.`id_product` = p.`id_product` AND ( cp.`id_category` = 1 OR p.`id_manufacturer` = ' . $id_manufacturer . '))'; $m = new Manufacturer( $id_manufacturer, $this->context->cookie->id_lang ); } Then what I was hoping to be able to do was use the actionProductListModifier hook to strip out products that didn't match the selected manufacture... But thats where it started to go wrong because I could not get pagination working correctly. The products were stripped out, but the page count still showed the total number of products as would have been shown without the filter enabled. So in the end, I had to resort to modding the core code. I modded Category.getProducts to take an id for manufacturer public function getProducts($id_lang, $p, $n, $order_by = null, $order_way = null, $get_total = false, $active = true, $random = false, $random_number_products = 1, $check_access = true, Context $context = null, $id_manuf = null) // around line 667 if(!empty($id_manuf)) { $sql .= ' AND p.id_manufacturer = '.(int)$id_manuf; } // around line 707 if(!empty($id_manuf)) { $sql .= ' AND p.id_manufacturer = '.(int)$id_manuf; } $sql .= ' GROUP BY product_shop.id_product'; Then changed every call to getProducts to pass in the cookie value. And for me, it works. But its a great big hack which is why wouldn't want to publish it as an actual module etc. Looking at the site you posted, its clear they have done the same. I suspect they have modded ManufactureController to take an extra query string option that determines the category. The modded the core getProducts function for class Manufacture to take this into account. Manufacture's I think are a bit of an after thought in PS. The out of the box implementation is pretty useless since I can't see any user wanting to see a FULL list of products by manufacture, unless you only have a few. The layered navigation filters go someway to sorting this out, but the navigation is still category "centric". For my hack above, I have had to live without the layered navigation manufacture filter which is a shame, but the industry my shop is in is very much about people shopping by brand, so this is what I had to do tutu box. If you ever find anything better, do post here. It works fabulously for separating product pages. Edited January 3, 2022 by kleipin (see edit history) Link to comment Share on other sites More sharing options...
Betz Developer Posted March 21, 2022 Share Posted March 21, 2022 On 12/27/2021 at 3:51 PM, w3bsolutions said: Hi, I have implemented a module for category filters (at the moment only categories) on the brand pages, see here or here, for PS 1.7. The module works in a similar fashion and same styles than the default faceted search module, meaning you initially see the first level categories and you can drill down to the last category. Filtering by a category includes products from its subcategories. When you enter a subcategory, it is added to the breadcrumb so you can go back up to parent categories. I plan to add more filters (price range, features, etc) in the future. If anybody is interested PM me. This is almost exactly what I need, but instead of "ajax filtering" it should redirect to a real URL, like your breadcrumb example suggests. So in your example, the "filtered" URL should be domain.tld/brands/studio-design/clothes/men/hoodies Could you make this possible @w3bsolutions ? Link to comment Share on other sites More sharing options...
w3bsolutions Posted March 30, 2022 Share Posted March 30, 2022 On 3/21/2022 at 11:37 PM, Betz Developer said: So in your example, the "filtered" URL should be domain.tld/brands/studio-design/clothes/men/hoodies Could you make this possible @w3bsolutions ? Sorry about the late reply. As mentioned in pm, I do not have the time right now to implement this change. 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