p1r4t0s Posted July 11, 2016 Share Posted July 11, 2016 Hello, Im trying to made a module like manufacturers-block but with a dropdown whit more filters like this: Example: DELL DELL ENTERPRISESERVERS TIPO RACK TIPO TOWER DELL NETWORKING SAMSUNG... I need code example or query examples to do it, any help will be apreciated. Image example: Link to comment Share on other sites More sharing options...
rocky Posted July 13, 2016 Share Posted July 13, 2016 Since it's not possible in PrestaShop to link categories to manufacturers, I think the easiest solution would be to create a category structure that includes the manufacturer names as the first level of categories and then add subcategories below them. 1 Link to comment Share on other sites More sharing options...
p1r4t0s Posted July 21, 2016 Author Share Posted July 21, 2016 Thankyou for your help. Link to comment Share on other sites More sharing options...
p1r4t0s Posted July 21, 2016 Author Share Posted July 21, 2016 you mean some like this: select p.id_product, p.id_manufacturer, id_category_default, l.name PName, c.name CName , m.name MName from hlg_product p inner join hlg_product_lang l on p.id_product = l.id_product inner join hlg_category_lang c on p.id_category_default = c.id_category inner join hlg_manufacturer m on p.id_manufacturer = m.id_manufacturer or this: select distinct p.id_manufacturer, id_category_default, m.name MName, c.name CName from hlg_product p inner join hlg_category_lang c on p.id_category_default = c.id_category inner join hlg_manufacturer m on p.id_manufacturer = m.id_manufacturer order by m.name, c.name Link to comment Share on other sites More sharing options...
p1r4t0s Posted July 21, 2016 Author Share Posted July 21, 2016 but now how to show it in tpl, and how to execute in the php class? public function hookLeftColumn($params) { $sql = 'select distinct p.id_manufacturer, id_category_default, m.name MName, c.name CName from hlg_product p inner join hlg_category_lang c on p.id_category_default = c.id_category inner join hlg_manufacturer m on p.id_manufacturer = m.id_manufacturer order by m.name, c.name '; if ($results = Db::getInstance()->ExecuteS($sql)) foreach ($results as $row) echo $row['id_shop'].' :: '.$row['name'].'<br />'; } Link to comment Share on other sites More sharing options...
rocky Posted July 22, 2016 Share Posted July 22, 2016 I meant going to Catalog > Categories and adding each manufacturer as a category there. That way, you don't need to modify any code. You can just use the "Categories block". 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