chops07876 Posted June 6, 2013 Share Posted June 6, 2013 (edited) Hi Everyone, I've added the line of code below to "product-list.tpl" which when viewed under "Manufacturer", displays the appropriate logo along with the product. <img src="{$img_manu_dir}{$manufacturer->id}.jpg" alt="{$manufacturer->name|escape:'htmlall':'UTF-8'}" title="{$manufacturer->name|escape:'htmlall':'UTF-8'}" /> The problem is, when products are viewed under "Categories", the image does not display. The image source writes the correct URL, except the actual image name is missing form the end. For example, a working link woud be: http://localhost:888...hop/img/m/4.jpg Whereas a failed link would be: http://localhost:888...shop/img/m/.jpg I'm sure this is a simple fix, but I'm very new to SQL/Prestashop and would really appreciate it if someone could assist with this. I'm running Prestashop v1.5.4.1 Thanks in advance. Rob. Edited June 6, 2013 by chops07876 (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted June 6, 2013 Share Posted June 6, 2013 I believe you're calling the wrong variable there. Unless you specified it, there is no $manufacturer set for each product in the list (in categories) as far as I know. Try with product.id_manufacturer instead 2 Link to comment Share on other sites More sharing options...
chops07876 Posted June 6, 2013 Author Share Posted June 6, 2013 Genius. Works a treat! I don't suppose you know the syntax for calling the manufacturer name for "Title" and "Alt"? Link to comment Share on other sites More sharing options...
NemoPS Posted June 6, 2013 Share Posted June 6, 2013 Wrong $product.manufacturer_name 2 Link to comment Share on other sites More sharing options...
chops07876 Posted June 6, 2013 Author Share Posted June 6, 2013 Perfect!! Thank you so much! Link to comment Share on other sites More sharing options...
Finefood Posted June 11, 2013 Share Posted June 11, 2013 Hi Rob I am very interested in using this code, could you tell me where in the product-list.tpl I insert the code? Kind Regards NIcholas Link to comment Share on other sites More sharing options...
chops07876 Posted June 14, 2013 Author Share Posted June 14, 2013 Nicholas, Certainly. Simply add this line of code wherever you want the logo to appear: <img src="{$img_manu_dir}{$product.id_manufacturer}.jpg" alt="{$product.manufacturer_name|escape:'htmlall':'UTF-8'}" title="{$product.manufacturer_name|escape:'htmlall':'UTF-8'}" /> You will need to apply styles to the image for formatting. Hope that helps. Rob. 1 Link to comment Share on other sites More sharing options...
beos77 Posted December 19, 2013 Share Posted December 19, 2013 Nicholas, Certainly. Simply add this line of code wherever you want the logo to appear: <img src="{$img_manu_dir}{$product.id_manufacturer}.jpg" alt="{$product.manufacturer_name|escape:'htmlall':'UTF-8'}" title="{$product.manufacturer_name|escape:'htmlall':'UTF-8'}" />You will need to apply styles to the image for formatting. Hope that helps. Rob. I tried to use the code above but it doesn't work properly on my prestashop website (1.5.6.1). There is only shown one logo while there are several manufacturers on one page. See goo.gl/VlFiPP for an example. I hope someone could help me out. Link to comment Share on other sites More sharing options...
vahidafshari Posted January 10, 2014 Share Posted January 10, 2014 Nicholas, Certainly. Simply add this line of code wherever you want the logo to appear: <img src="{$img_manu_dir}{$product.id_manufacturer}.jpg" alt="{$product.manufacturer_name|escape:'htmlall':'UTF-8'}" title="{$product.manufacturer_name|escape:'htmlall':'UTF-8'}" />You will need to apply styles to the image for formatting. Hope that helps. Rob. Thank you so much Link to comment Share on other sites More sharing options...
kmichalaros Posted February 15, 2014 Share Posted February 15, 2014 (edited) In case someone needs it, this worked for me on 1.5.6.2, i also added an if statement to check if the manufacturer has an image {assign var="manpic" value="img/m/{$product_manufacturer->id_manufacturer}.jpg"} {if file_exists($manpic)} <div class="product_manufacturer" style="margin-bottom:15px;"> <a style="float:left; display:block;margin-right:40px;" href="{$content_dir}manufacturer.php?id_manufacturer={$product_manufacturer->id_manufacturer}" title="{l s='View all products'}"> <img src="{$content_dir}img/m/{$product_manufacturer->id_manufacturer}-small_default.jpg" /></a> <div style="float:left; display:block;"><strong>View all products from</strong><h3><a href="{$content_dir}manufacturer.php?id_manufacturer={$product_manufacturer->id_manufacturer}">{$product_manufacturer->name}</a></h3></div> </div> {/if} Edited February 16, 2014 by kmichalaros (see edit history) 1 Link to comment Share on other sites More sharing options...
Denver Prophit Jr. Posted March 11, 2015 Share Posted March 11, 2015 (edited) What should be checked if manufacturer logo's are not being rendered from /img/tmp to /img/su/ ? I see the images in /img/tmp We run PHP_DSO and /img folder is group owned to apache with group write access. All sub-directories within /img are also group owned to apache with group write access. Edited March 11, 2015 by Denver Prophit Jr. (see edit history) Link to comment Share on other sites More sharing options...
Denver Prophit Jr. Posted March 12, 2015 Share Posted March 12, 2015 Nevermind I fixed it. The theme developer used the wrong smarty variable for manufacturer folder. Baffles me why PrestaShop allows templates to be sold that are so problematic. Link to comment Share on other sites More sharing options...
benzenewings Posted June 10, 2015 Share Posted June 10, 2015 Nevermind I fixed it. The theme developer used the wrong smarty variable for manufacturer folder. Baffles me why PrestaShop allows templates to be sold that are so problematic. Can you shed light on this? I am using the default template but receiving an error. . Undefined index: product_manufacturer in bla/bla/tools/smarty/sysplugins/smarty_internal_templatebase.php : eval()'d code on line 63. HELP ? Link to comment Share on other sites More sharing options...
benzenewings Posted June 10, 2015 Share Posted June 10, 2015 version 1.6 , default bootstrap template. Link to comment Share on other sites More sharing options...
NemoPS Posted June 10, 2015 Share Posted June 10, 2015 Which 1.6?I have no such variable on my .14 default one Link to comment Share on other sites More sharing options...
benzenewings Posted June 10, 2015 Share Posted June 10, 2015 Hi Nemo, thanks for chiming in... I am using PrestaShop version 1.6.0.14 - What is the proper code to do this in Prestashop 1.6, and where exactly (line) should it go in the products-list.tpl file? Link to comment Share on other sites More sharing options...
NemoPS Posted June 10, 2015 Share Posted June 10, 2015 I don't recall off the top of my head, try this within the loop and see what the name is{$product|@debug_print_var} Link to comment Share on other sites More sharing options...
benzenewings Posted June 10, 2015 Share Posted June 10, 2015 Got it to work. Puting it on line 65 right after the quick view section finally showed an image from manufacturer. Thanks! On another manufacturer note, I've seen some people on here get manufacturers from a category and display them on category pages. example, CD Players category clicked shows Sony, Emerson, GE, Pioneer on the Category page. All of the info out there is for 1.4 versions and does not work for 1.6... I've posted replies on those forum threads, but no response , probably because theyre marked solved' from 2012, ha. If you have any light to shed on this task, I'm eager to hear. Thanks. Link to comment Share on other sites More sharing options...
kalaiarasan Posted September 7, 2015 Share Posted September 7, 2015 Hi I am using third party module to display products on the homepage.And I am suppose to display supplier logo on the product list and i used the code <img src="{$img_sup_dir}{$product.id_supplier}-medium.jpg" alt="{$product.supplier_name|escape:'htmlall':'UTF-8'}" title="{$product.supplier_name|escape:'htmlall':'UTF-8'}" /> but it display only question mark above the product image.Kindly please tell me the php code to acquire the suppliers from the database to that module. Module that I used enclosed below with screenshot homecategoriebyid.zip Link to comment Share on other sites More sharing options...
NemoPS Posted September 9, 2015 Share Posted September 9, 2015 are you sure the "medium" size exists? Link to comment Share on other sites More sharing options...
kalaiarasan Posted September 9, 2015 Share Posted September 9, 2015 Thank you Nemo for your reply ,I achieved myself what I have expected and you can see the result from my website vanakkamshoppers.com. And of-course medium size works great Best Regards VanakkamShoppers.com Link to comment Share on other sites More sharing options...
estebanrojasmex Posted April 15, 2016 Share Posted April 15, 2016 Any update code for 1.6.1.5? 1 Link to comment Share on other sites More sharing options...
Vilius PromoApranga Posted November 28, 2016 Share Posted November 28, 2016 Any update code for 1.6.1.9? Link to comment Share on other sites More sharing options...
NemoPS Posted November 30, 2016 Share Posted November 30, 2016 That should still work, is it not? Link to comment Share on other sites More sharing options...
suheyl_senturk Posted February 21, 2017 Share Posted February 21, 2017 hi this is 1.6.1.9 code <img src="img/tmp/manufacturer_{$manufacturer.id_manufacturer|escape:'html':'UTF-8'}.jpg" alt="{$manufacturer.name|escape:'html':'UTF-8'}" /> Link to comment Share on other sites More sharing options...
Gipielle Posted June 5, 2017 Share Posted June 5, 2017 Thanks In case someone needs it, this worked for me on 1.5.6.2, i also added an if statement to check if the manufacturer has an image {assign var="manpic" value="img/m/{$product_manufacturer->id_manufacturer}.jpg"} {if file_exists($manpic)} <div class="product_manufacturer" style="margin-bottom:15px;"> <a style="float:left; display:block;margin-right:40px;" href="{$content_dir}manufacturer.php?id_manufacturer={$product_manufacturer->id_manufacturer}" title="{l s='View all products'}"> <img src="{$content_dir}img/m/{$product_manufacturer->id_manufacturer}-small_default.jpg" /></a> <div style="float:left; display:block;"><strong>View all products from</strong><h3><a href="{$content_dir}manufacturer.php?id_manufacturer={$product_manufacturer->id_manufacturer}">{$product_manufacturer->name}</a></h3></div> </div> {/if} Thanks! I use a part for place logo in product.tpl {assign var="manpic" value="img/m/{$product_manufacturer->id_manufacturer}.jpg"} {if file_exists($manpic)} <img src="{$content_dir}img/m/{$product_manufacturer->id_manufacturer}-large_default.jpg" alt="{$product_manufacturer->name|escape:'htmlall':'UTF-8'}"/> {/if} Link to comment Share on other sites More sharing options...
Sergio Posted October 20, 2018 Share Posted October 20, 2018 On 9/9/2015 at 9:27 AM, kalaiarasan said: Thank you Nemo for your reply ,I achieved myself what I have expected and you can see the result from my website vanakkamshoppers.com. And of-course medium size works great Best Regards VanakkamShoppers.com Hi, I am with prestashop 1.6.1.17, and i have used another code, but my "Best Sellers" shows like yours before you get it to work. Can you tell me what code you have used to put it working? Thanks 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