Jump to content

Display Manufacturer Logo in Manufacturer Module


Recommended Posts

In /themes/[your theme]/manufacturer.tpl you can modify your manufacturer page.

I'm trying to insert the manufacturer's logo there too. Here is how i'm writing it:

{include file=$tpl_dir./errors.tpl}

{include file=$tpl_dir./binding_top.tpl}

           [b][/b]

{include file=$tpl_dir./binding_bottom.tpl}



The thing is, {$manufacturer.image} is not working here (I checked and other variables like $manufacturer.name work just fine), so it is not showing the logo and is crashing the rest of the page's code so nothing further is being shown in the browser.

A similar piece of code is used in manufacturer-list.tpl:



but it is not working for me either, in manufacturer.tpl.

Please, let me know if you can get this right.

Any advice here?

Link to comment
Share on other sites

got it!

I attached the code as it can be seen in my manufacturer.tpl file.

within div.logo will be shown the manufacturer's logo and name. Now, just go to your theme's style.css file and make it look nice ;D

I'm pending to add the error management code in case one given manufacturer does not have any logo or it is not found, to make it show a default image...right now, it would show the image's alt text (in this case, the manufacturer's name) if no logo is found.

I hope you find this useful.

37074_xaBAcnlXsw2bh9lFYhGW_t

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hi Vinesh,

Thank you for stopping in to help. I tried your code and even though it did seem like it was heading in the right direction, for some reason, it printed some codes on the front end. I could see the manufacturer's image though.

Here's the manufacturer.tpl, could you please tell me where I need to put your codes?

<!-- Block manufacturers module -->

{l 

s='Manufacturers' mod='blockmanufacturer'}

{if $manufacturers}
   {if $text_list}

   {foreach from=$manufacturers item=manufacturer name=manufacturer_list}
       {if $smarty.foreach.manufacturer_list.iteration <= $text_list_nb}

>getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)}" title="{l s='More 

about' mod='blockmanufacturer'} {$manufacturer.name}">{$manufacturer.name|escape:'htmlall':'UTF-8'}
       {/if}
   {/foreach}

   {/if}
   {if $form_list}
       <form action="{$smarty.server.SCRIPT_NAME}" method="get">



{l s='All manufacturers' mod='blockmanufacturer'}
               {foreach from=$manufacturers item=manufacturer}
{$manufacturer.name|escape:'htmlall':'UTF-8'}
               {/foreach}


       </form>
   {/if}
{else}

{l s='No manufacturer' mod='blockmanufacturer'}
{/if}


<!-- /Block manufacturers module -->

Link to comment
Share on other sites

Hi Vinesh,
Thanks for giving me the tips but your code still spits out codes in the front page.
So I figured it out by myself.

What I did was I replaced the code from line 10

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



by

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

Link to comment
Share on other sites

  • 2 weeks later...

Hi,
I am trying to do the same with my suppliers module. But I cannot figure out what would be in place of this:

{$img_manu_dir}{$manufacturer.id_manufacturer}-small.jpg

The above code was for manufacturer module and it worked fine.
Now what would be the correspoding



for supplier module?
Does someone have an idea

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...
Hi Vinesh,

Thanks for giving me the tips but your code still spits out codes in the front page.

So I figured it out by myself.

 

What I did was I replaced the code from line 10

 

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

 

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

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 3 months later...
  • 7 months later...
  • 2 months later...

in your blockmanufacturer.tpl change this line:

 

"<li class="{if $smarty.foreach.manufacturer_list.last}last_item{elseif $smarty.foreach.manufacturer_list.first}first_item{else}item{/if}"><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'}</a></li>"

 

to

 

 

"<a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)}" title="{l s='More about' mod='blockmanufacturer'} {$manufacturer.name}">

<img src="{$img_manu_dir}{$manufacturer.id_manufacturer}.jpg" />

</a>"

Link to comment
Share on other sites

in your blockmanufacturer.tpl change this line:

 

"<li class="{if $smarty.foreach.manufacturer_list.last}last_item{elseif $smarty.foreach.manufacturer_list.first}first_item{else}item{/if}"><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'}</a></li>"

 

to

 

 

"<a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)}" title="{l s='More about' mod='blockmanufacturer'} {$manufacturer.name}">

<img src="{$img_manu_dir}{$manufacturer.id_manufacturer}.jpg" />

</a>"

 

Does it work for any Prestashop version?

 

Thanks

Link to comment
Share on other sites

I have scratch my head to put image insted of manufacture link . Here I have very nice solution to display manufacture logo

 

<a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)}" title="{l s='More about' mod='manufacturerlogos'} {$manufacturer.name}"> <img src="{$img_manu_dir}{$manufacturer.id_manufacturer}.jpg"  /></a></li>

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 months later...
  • 4 months later...
  • 5 months later...

Works for me on 1.5.2.. but with a little adjustment:

<img src="{$img_manu_dir}{$manufacturer.id_manufacturer}.jpg" />

changed to

<img src="{$img_manu_dir}{$manufacturer.id_manufacturer}-medium_default.jpg" />

 

 

I try to add this code in manufacturer.tpl (I want the manufacturer logo on this page) but it's doesn't work. (prestashop 1.5.6.1)

Do you have some ideas?

 

thanks for the help.

Link to comment
Share on other sites

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...