Marianosc Posted February 8, 2013 Share Posted February 8, 2013 (edited) Hi, I am trying to do exactly what was achieved in the thread below, except it was done pre-PS1.5 many moons ago: http://www.prestasho...-category-page/ Basically I want to add a list of manufactures within that specific category and its subcategories so that it can be filtered on. This is when looking at the product-list view. I follow and understand what was achieved in the tread but am struggling to adapt it to PS1.5+ structure. Any assistance is greatly appreciated. Cheers, Mariano. Edited February 23, 2013 by Marianosc (see edit history) Link to comment Share on other sites More sharing options...
Juandbbam Posted February 19, 2013 Share Posted February 19, 2013 Hi, I'm looking for exactly the same. Anybody may help please? Thank you in advance )) Link to comment Share on other sites More sharing options...
Marianosc Posted February 23, 2013 Author Share Posted February 23, 2013 Well I figured it out. Needed to to create a Category Contoller Override Then in the "class CategoryController extends CategoryControllerCore" Copy the original "assignProductListModify" from CategoryController.php and at the end of the funtion "public function assignProductList()" you need to modify it to the following: $this->manufacturers = array(); if ($this->cat_products) foreach ($this->cat_products as &$product) { $this->manufacturers[$product['id_manufacturer']] = new Manufacturer(intval($product['id_manufacturer']), $this->context->language->id); } $this->context->smarty->assign(array( 'nb_products', $this->nbProducts, 'manufacturers' => $this->manufacturers, )); Hope that helps anyone else looking to do the same. Cheers, Mariano. Link to comment Share on other sites More sharing options...
Nookyx Posted March 21, 2013 Share Posted March 21, 2013 Well I figured it out. Needed to to create a Category Contoller Override Then in the "class CategoryController extends CategoryControllerCore" Copy the original "assignProductListModify" from CategoryController.php and at the end of the funtion "public function assignProductList()" you need to modify it to the following: $this->manufacturers = array(); if ($this->cat_products) foreach ($this->cat_products as &$product) { $this->manufacturers[$product['id_manufacturer']] = new Manufacturer(intval($product['id_manufacturer']), $this->context->language->id); } $this->context->smarty->assign(array( 'nb_products', $this->nbProducts, 'manufacturers' => $this->manufacturers, )); Hope that helps anyone else looking to do the same. Cheers, Mariano. Got this working so far (I have data in the manufacturer array), but how do I add the dropdown to filter by these manufacturers in the product-list? Link to comment Share on other sites More sharing options...
Marianosc Posted March 23, 2013 Author Share Posted March 23, 2013 Nookyx, In my case I was populating the product-list.tpl with a list of checkboxes of manufactures instead of a dropdown list. Below is my code which you should be able to modify to a dropdown list instead: {if $manufacturers|@count >1} <li> <strong>Manufactures</strong> <ul id="filter_manufactures"> {if isset($manufacturers)} <!-- Manufacturers --> {foreach from=$manufacturers item=manufacturer} <li> <input type='checkbox' class='filterCheckbox filterCheckboxManufactures' id='Filter-{$manufacturer->name|escape:'htmlall':'UTF-8'}' name='Filter-{$manufacturer->name|escape:'htmlall':'UTF-8'}' value='{$manufacturer->name|escape:'htmlall':'UTF-8'}' /> {$manufacturer->name|escape:'htmlall':'UTF-8'} </li> {/foreach} {/if} </ul> </li> {/if} Cheers, Mariano Link to comment Share on other sites More sharing options...
Nookyx Posted March 23, 2013 Share Posted March 23, 2013 thanks so far, I've been able to list them in a dropdown. But how does the actual filtering occur? I guess I need to override some functions, but which ones, where and how? I'm stuck here atm Link to comment Share on other sites More sharing options...
amar.prestashop Posted August 14, 2013 Share Posted August 14, 2013 Hi I need the same thing, i like to list the manufacturer under categories so i can use filter navigation block on manufacturer. But is not clear how to implement it, can you explain in a more simple way ? Thanks, Link to comment Share on other sites More sharing options...
faDdy Posted December 15, 2013 Share Posted December 15, 2013 Does anyone know how to do this on Prestashop 1.4.8.2 ? Thank you. Link to comment Share on other sites More sharing options...
benzenewings Posted June 8, 2015 Share Posted June 8, 2015 I need same thing, Manufactures (brands) under category, showing brands icons available in that category. Please assist. Link to comment Share on other sites More sharing options...
benzenewings Posted June 8, 2015 Share Posted June 8, 2015 I saw you had a breakthrough getting the manufacturers listed on categories for 1.5. I am trying to use your code on 1.6 and perhaps missing a step. I added the override on categorycontroller and added the call in productslist.tpl. . .is there anywhere else I need to edit? Best I get on the front page is.. Undefined index: manufacturers in tools/smarty/sysplugins/smarty_internal_templatebase.php(171) : eval()'d code on line 53 Maybe I have the override added wrong? Any help is greatly appreciated. Link to comment Share on other sites More sharing options...
eagleman Posted July 30, 2018 Share Posted July 30, 2018 Hi Any idea how it works for PS 1.7 Need Help regards Link to comment Share on other sites More sharing options...
cbsmarty Posted April 24, 2019 Share Posted April 24, 2019 I also need help for this? Anyone? 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