Jump to content

[SOLVED] PS 1.5 get manufacturer image link


gr4devel

Recommended Posts

Hiya,

 

From what I can tell, there are no existing methods for this task. Following is how 1.5.4.1 manufacturer-list.tpl prints image sources:

 

{$img_manu_dir}{$manufacturer.image|escape:'htmlall':'UTF-8'}-medium_default.jpg

 

($manufacturer.image is equal to the manufacturer's id iff an image exists, otherwise the default image for current language)

 

 

An embarrasingly hackish solution I've used on a shop to display manufacturer logos on the product pages:

 

{capture name="manu_pic"}img/m/{$product->id_manufacturer}-medium.jpg{/capture}
{if file_exists($smarty.capture.manu_pic)}
<div id="manufacturer-logo">
 <a href="{$link->getmanufacturerLink($product->id_manufacturer, $product->link_rewrite)}">
<img src="/{$smarty.capture.manu_pic}" alt="{$product->manufacturer_name|escape:'htmlall':'UTF-8'}"/>
 </a>
</div>
{/if}  

 

Providing you're working with templates, these examples might give you some ideas, otherwise let me know :)

Edited by jgullstr (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Thanks a lot, jgullstr :). For Prestashop 1.5.6 I used a small variation of your code:

 

{capture name="manu_pic"}img/m/{$product->id_manufacturer}-medium.jpg{/capture}
{if file_exists($smarty.capture.manu_pic)}
<div id="manufacturer-logo">
  <a href="{$link->getmanufacturerLink($product->id_manufacturer, $manufacturer.link_rewrite)}">
<img src="/{$smarty.capture.manu_pic}" alt="{$product->manufacturer_name|escape:'htmlall':'UTF-8'}"/>
  </a>
</div>
{/if} 
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...