Smarty Question

Prestashop : Display list Manufacturers in Footer

I'm working with prestashop and I was thinking of How is it possible to display a list of all the manufacturer in the footer.

So in my footer.tpl I did this :

{if $nbManufacturers > 0}
<div class="row">
<h2>All manufacturers</h2>
<ul id="manufacturers_list">
{foreach from=$manufacturers item=manufacturer name=manufacturers}
<li><img src="{$img_manu_dir}{$manufacturer.image|escape:'htmlall':'UTF-8'}-medium_default.jpg" alt="{$manufacturer.name|truncate:60:'...'|escape:'htmlall':'UTF-8'}" /></li>
{/foreach}
</ul>
</div>
{/if}


But this isn't displaying anything... Am I bad? Is it possible or I have to use a plugin?

Answer

you can edit or create a ovverride of classes/controller/FrontController.php

inserting before

$this->smartyOutputContent(_PS_THEME_DIR_.'footer.tpl');

this

$this->smarty->assign(array(
            'manufacturers' => $manufacturers,
            'nbManufacturers' => count($manufacturers)
        ));
Comments