Jump to content

manufacturer image


Recommended Posts

In PrestaShop v1.7, all the link variables are no longer available in Smarty. Instead, there's a new {url} syntax that calls Link::getUrlSmarty($params). Unfortunately, I don't see an option to get the manufacturer image URL. You could override the function to add this functionality or simply add code to your module's PHP file to assign a variable you can use in Smarty like this:
$this->context->smarty->assign('manufacturer_image', $this->context->link->getManufacturerImageLink((int)$id_manufacturer, 'small_default'));

Change $id_manufacturer to the manufacturer ID from your module and 'small_default' to the size you want the image.

 

  • Like 1
Link to comment
Share on other sites

Thank you rocky...

this function getManufacturerImageLink() was crucial! 

this is my code:
 

<img
     src = "{$link->getManufacturerImageLink($manufacturer.id_manufacturer, 'small_default')}"
     alt = "{$manufacturer.name|escape:html:'UTF-8'}"
>
Edited by Vencule (see edit history)
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...