cjrent Posted July 19, 2013 Share Posted July 19, 2013 Hey everyone, First I am very new to Prestashop (less than a couple of days now). I love what I see so far and this forum has been very valuable in helping me out. I'm trying to add the Manufacturer Block dropdown list to the top menu. I've gotten this far, but the menu is empty. I've added this between the <ul> <select id="manufacturer_list" onchange="autoUrl('manufacturer_list', '');"> <option value="0">{l s='Artist Bios' mod='blockmanufacturer'}</option> {foreach from=$manufacturers item=manufacturer} <option value="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)}">{$manufacturer.name|escape:'htmlall':'UTF-8'}</option> {/foreach} </select> . The site I am using to learn all this on is: http://boojh.x10host.com/ps/index.php You can see the little dropdown list to the right. I don't like how it looks. I'd love to see it look like the All Our Products list, but I'm not sure how to get that going. Thank you in advance for your advice. Link to comment Share on other sites More sharing options...
razaro Posted July 19, 2013 Share Posted July 19, 2013 Try this: in blocktopmenu.php replace hookDisplayTop (one line with all manufacturers is added) public function hookDisplayTop($param) { $this->user_groups = ($this->context->customer->isLogged() ? $this->context->customer->getGroups() : array(Configuration::get('PS_UNIDENTIFIED_GROUP'))); $this->page_name = Dispatcher::getInstance()->getController(); if (!$this->isCached('blocktopmenu.tpl', $this->getCacheId())) { $this->makeMenu(); $this->smarty->assign('MENU_SEARCH', Configuration::get('MOD_BLOCKTOPMENU_SEARCH')); $this->smarty->assign('MENU', $this->_menu); $this->smarty->assign('this_path', $this->_path); } $this->smarty->assign('manufacturers', Manufacturer::getManufacturers()); $this->context->controller->addJS($this->_path.'js/hoverIntent.js'); $this->context->controller->addJS($this->_path.'js/superfish-modified.js'); $this->context->controller->addCSS($this->_path.'css/superfish-modified.css'); $html = $this->display(__FILE__, 'blocktopmenu.tpl', $this->getCacheId()); return $html; } Then change code in blocktopmenu.tpl to {if $MENU != ''} <!-- Menu --> <div class="sf-contener clearfix"> <ul class="sf-menu clearfix"> {$MENU} <li> <a href="{$link->getPageLink('manufacturer')|escape:'html'}" title="{l s='Artist Bios' mod='blocktopmenu'}">{l s='Artist Bios' mod='blocktopmenu'}</a> <ul> {foreach from=$manufacturers item=manufacturer name=manufacturer_list} <li> <a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)|escape:'html'}" title="{l s='Learn more about' mod='blockmanufacturer'} {$manufacturer.name}">{$manufacturer.name|escape:'htmlall':'UTF-8'}</a> </li> {/foreach} </ul> </li> {if $MENU_SEARCH} <li class="sf-search noBack" style="float:right"> <form id="searchbox" action="{$link->getPageLink('search')}" method="get"> <p> <input type="hidden" name="controller" value="search" /> <input type="hidden" value="position" name="orderby"/> <input type="hidden" value="desc" name="orderway"/> <input type="text" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|escape:'htmlall':'UTF-8'}{/if}" /> </p> </form> </li> {/if} </ul> </div> <div class="sf-right"> </div> <!--/ Menu --> {/if} Note that this will be very long list for menu item. Also check this great tutorial http://nemops.com/alphabetical-prestashop-manufacturers/ Maybe it would be great to combine it to menu but probably that is bit more work. Link to comment Share on other sites More sharing options...
cjrent Posted July 19, 2013 Author Share Posted July 19, 2013 thank you. running out to dinner, but i'll certainly give it a try. Link to comment Share on other sites More sharing options...
cjrent Posted July 20, 2013 Author Share Posted July 20, 2013 Wow super close. I don't get the dropdown list yet. But I'm going to search around some more and see what I can figure out (sometimes I get lucky). If you can think of something I might be missing, I'd certainly appreciate it. And thank you again for such a quick reply. Link to comment Share on other sites More sharing options...
vekia Posted July 20, 2013 Share Posted July 20, 2013 you can use also something like this: (no core modifications) {foreach from=Manufacturers::getMaufacturers() item=manufacturer name=manufacturer_list} <li> <a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)|escape:'html'}" title="{l s='Learn more about' mod='blockmanufacturer'} {$manufacturer.name}">{$manufacturer.name|escape:'htmlall':'UTF-8'}</a> </li> {/foreach} don't forget to run "force compilation" and turn off cache while you're working on your template Link to comment Share on other sites More sharing options...
cjrent Posted July 20, 2013 Author Share Posted July 20, 2013 Thank you both for your help. So as not to make changes to the core files as recommended in this forum, I've done the following... A) I created a new theme using the default theme files. In mytheme/modules/ I created a folder called blocktopmenu and placed the modified blocktopmenu.php and blocktopmenu.tpl files in there C) I turned off cache and ran force compilation D) I also did the theme modifications as recomended in http://nemops.com/alphabetical-prestashop-manufacturers/ Vekia...I tried your suggestion, but it seemed to make my entire site look like a sitemap. (I'm sure I did something wrong there) Razaro...Your suggestion get's me as close as I think may be possible although I get no dropdown the way I do in All Our Products, It does take me to the manufacturers list. I'll keep trying to make that a dropdown link, only because I know that that is how the person I am doing this for wants it. The nemops tutorial was fantastic and does clean up the list very nicely. I have a question to him on how I can make all the manufacturer's name linked even if they have no products. The test site I am using to get all my ducks in a row is http://boojh.x10host.com/ps/index.php My thanks again to both of you and to the others who's posts I have also used in my quest to get this site up and running. Keep up the good work in this forum. I really did find many useful tips. Link to comment Share on other sites More sharing options...
PascalVG Posted August 20, 2013 Share Posted August 20, 2013 Hi paditur, razaro, I just made some changes to put a manufacturers list neatly in the top horizontal menu. See this topic: http://www.prestashop.com/forums/index.php?/topic/268662-questionhow-to-add-link-to-the-navigation-header/page__view__findpost__p__1346110 Hope this helps, pascal Link to comment Share on other sites More sharing options...
cjrent Posted August 20, 2013 Author Share Posted August 20, 2013 PascalVG, thank you so much. I'll totally use it. You're the best! Link to comment Share on other sites More sharing options...
Recommended Posts