gr4devel Posted August 29, 2013 Share Posted August 29, 2013 (edited) Hi community . Is there a good method, beside the manual construction, to get the link of the image associated to a given manufacturer? Edited August 30, 2013 by gr4devel (see edit history) Link to comment Share on other sites More sharing options...
jgullstr Posted August 30, 2013 Share Posted August 30, 2013 (edited) 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 August 30, 2013 by jgullstr (see edit history) Link to comment Share on other sites More sharing options...
gr4devel Posted August 30, 2013 Author Share Posted August 30, 2013 Thank you very much jgullstr . I already knew this method and now I think that it remains the only one to get the manufacturer image link. Btw thank you again for your interest concerning my curiosity . Link to comment Share on other sites More sharing options...
moy2010 Posted October 20, 2013 Share Posted October 20, 2013 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 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