qimzu Posted May 5, 2014 Share Posted May 5, 2014 Hi, I need to show manufacturer (brand in my case) on invoices. And as a bonus, UPC product code I have my .tpl in the theme (pdf folder) so no problem with Prestashop upgrade. I am ok with html / css... but php / smarty I am not familiar with. I have tried with {$img_manu_dir}, but that does not seem to be working to retrieve manufacturer images. Any ideas ? I am on the latest version of Prestashop (1.6) Best regards, Quentin Link to comment Share on other sites More sharing options...
qimzu Posted May 5, 2014 Author Share Posted May 5, 2014 To show UPC code I have added UPC : {$order_detail.product_upc} It seems to be working. Link to comment Share on other sites More sharing options...
vekia Posted May 5, 2014 Share Posted May 5, 2014 thank you for providing soluton so, thread is solved? Link to comment Share on other sites More sharing options...
qimzu Posted May 5, 2014 Author Share Posted May 5, 2014 Nop sorry. Still need to display manufacturer logo or name in invoice Link to comment Share on other sites More sharing options...
qimzu Posted May 5, 2014 Author Share Posted May 5, 2014 (edited) Here is an exemple of what I need to achieve. Add manufacturer's logo on Prestashop invoice. Edited May 5, 2014 by qimzu (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted May 5, 2014 Share Posted May 5, 2014 You should have {$order_detail.id_manufacturer} data available in the template. Try something like: {Manufacturer::getNameById($order_detail.id_manufacturer)} Note: the code is not tested and can be completely wrong Link to comment Share on other sites More sharing options...
qimzu Posted May 6, 2014 Author Share Posted May 6, 2014 Hi, This works to show the name of the manufacturer, so this is cool, thanks. Is there a way to show the logo (image linked to the manufacturer in BO), instead of name? Best regards, Quentin Link to comment Share on other sites More sharing options...
qimzu Posted May 7, 2014 Author Share Posted May 7, 2014 This seems to retrieve the image, at least create the right URL (PS 1.6) : <img src="{$img_ps_dir}m/{$order_detail.id_manufacturer}.jpg" style="vertical-align:middle"/> But then I have : TCPDF ERROR: [image] Unable to get image: {image URL} Any ideas where this comes from? I read about php configuration, but has the url works, why does it can't get the image? Best regards, Quentin Link to comment Share on other sites More sharing options...
UniqueModules Posted May 16, 2014 Share Posted May 16, 2014 (edited) This seems to retrieve the image, at least create the right URL (PS 1.6) : <img src="{$img_ps_dir}m/{$order_detail.id_manufacturer}.jpg" style="vertical-align:middle"/> But then I have : TCPDF ERROR: [image] Unable to get image: {image URL} Any ideas where this comes from? I read about php configuration, but has the url works, why does it can't get the image? Best regards, Quentin The reason why u getting the error is because you did not assign manufacturer to all products in the order you trying to render the invoice so once the foreach found one product without manufacturer (ID) the value is then zero and 0.jpg does not exist in the m folder this why TCPDF class shows the error. The solution is to put there condition when the manufacturer ID exist for the product then show the image if not do nothing. this code should work for you: {if $order_detail.id_manufacturer}<img src="{$img_ps_dir}m/{$order_detail.id_manufacturer}.jpg" style="vertical-align:middle"/>{/if} Edited May 16, 2014 by UniqueModules (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts