Vencule Posted February 8, 2017 Share Posted February 8, 2017 Can somebody help me please.How to pull url for manufacturer image in PrestaShop 1.7?on my module for Prestashop 1.6 it was with {$img_manu_dir} and now this is not working.Thanks Link to comment Share on other sites More sharing options...
Vencule Posted February 8, 2017 Author Share Posted February 8, 2017 Yes well...I tried to do that first...but can't find solution that is why I'm asking... Link to comment Share on other sites More sharing options...
rocky Posted February 9, 2017 Share Posted February 9, 2017 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. 1 Link to comment Share on other sites More sharing options...
Vencule Posted February 9, 2017 Author Share Posted February 9, 2017 (edited) 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 February 9, 2017 by Vencule (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now