Jump to content

[SOLVED] Manufacturers list in footer


Recommended Posts

Create a file modules/blockmanufacturer/blockmanufacturer-footer.tpl containing the following:

{l s='We carry the following brands:' mod='blockmanufacturer'}
{foreach from=$manufacturers item=manufacturer name=manufacturer_list}
<a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)}" title="{l s='More about' mod='blockmanufacturer'} {$manufacturer.name}">{$manufacturer.name|escape:'htmlall':'UTF-8'}{if !$smarty.manufacturer_list.last},{/if}
{/foreach}



Then add the following function before the last } in modules/blockmanufacturer/blockmanufacturer.php:

function hookFooter($params)
{
   global $smarty, $link;

   $smarty->assign(array(
       'manufacturers' => Manufacturer::getManufacturers(),
       'link' => $link,
   ));
   return $this->display(__FILE__, 'blockmanufacturer-footer.tpl');
}



I haven't tested this code, but it should let you transplant the manufacturer block in the footer, then display all the manufacturers like on that site.

  • Like 1
Link to comment
Share on other sites

Hi Rocky!

Thanks!

I was hoping for your answer, since you are one of those guys which are makeing our lives (non programers) much easier. :-)

I have been trying to find solution (combining tips) but no luck.



If someone else would like to use this solution (which I thing is very practical if you have a lot of brands - also for SEO) there are just two modifications from upper instructions:

new .tlp file should be: blockmanufacturer-footer.tpl (not blockmanufacter-footer.tpl)

and you need (I did that) to remove (not to paste) code which is coded lower. Paste only code between

getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)}" title="{l s='More about' mod='blockmanufacturer'} {$manufacturer.name}">{$manufacturer.name|escape:'htmlall':'UTF-8'}

{if !$smarty.manufacturer_list.last},{/if}
Link to comment
Share on other sites

  • 7 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...