Jump to content

v.1.6 TCPDF ERROR: [Image] Unable to get image:


Recommended Posts

Hello,

I hope someone can help me with this problem. I've found a few old threads about it but nothing that solves my problem.

If I enable product images on invoice I get this error message on checkout. TCPDF ERROR: [image] Unable to get image: /img/tmp/product_mini_8_63.jpg

Also if I go into my orders and want to print the invoice I get the same error message.

But if I'm in the admin panel it works perfect. I can generate a PDF with no errors. So it seems it's just for customers it doesn't work.

 

Someone who have had the same problem? Or who might know a solution?

I changed the permission on the picture to 644 and also tried 755 with no results.

Thanks

 

 

 

 

 

Link to comment
Share on other sites

The location of img on your invoice is not correct. It is loading from a tmp folder cause when you uploaded it, the process didn't completed. Upload the logo for your invoices again on the tab "preferences -> themes -> logo mail and invoices and check.

 

Correct folder for the invoice image is: /img/logo.jpg

 

It is strange that your link is showing /product_mini_8_63.jpg. Did you changed something on core? Are you printing a thumb of the product in your invoices ? If yes, you should undo the adaptations you have done. Natively Prestashop is not showing thumbs of products on invoices.

Edited by selectshop.at (see edit history)
  • Like 1
Link to comment
Share on other sites

Thanks for the reply selectshop.at

I tried to upload the logo again with no success. I really need the thumb to be on the invoices, a key function for my business.
And that's why I went for prestashop cause I saw that they had that option. I haven't installed any modules or changed anything in core.
Showing thumbs in the invoice was a built in future when I installed prestashop. 1.6 . On Preferences > Orders I have an option called. (Enable product image on Invoice)

Thanks.

 

Link to comment
Share on other sites

Do the following: Simply add your image in the size 350x81px through FTP to the folder /img as logo_invoice.jpg. This is the correct name and localization where the code is searching for the logo.

 

If this also not solves than check the following:

 

If you find on FTP /img another file with a name and -logo_invoice-123124906.jpg for ex. than delete this file and retry to upload the file from your back-office.

Edited by selectshop.at (see edit history)
Link to comment
Share on other sites

Hi again, thank you for the tip. I tried that and that didn't work either. Cause the logo doesn't seem to be a problem. If I disable product thumbnails on invoice everything works perfect. But I really need the option with the product thumbnails on invoice to work. But The strange part is that I haven't changed anything in core. Just a fresh installation of 1.6.  

Link to comment
Share on other sites

Sorry. I'm new to Prestashop. But what do you mean with native? My webhost provides a "one click installer" for different systems (prestashop, opencart, wordpress, jomla) and other things. I just installed the Prestashop they had there. PrestaShop version: 1.6.0.14

Link to comment
Share on other sites

Native = no changes on core. As you added own code for to have the thumbs on the invoice, this is not a native problem, but a problem of the change made. Therefore I cannot help you.

Product thumbs on invoices is not a native feature, but one added by someone (bought/free non native theme, module, etc).

Link to comment
Share on other sites

But having thumbs on invoice is native. It is not a bought/free module. If you go to prestahops demo. And go to the backend you can see that it is built in.
I took a printscreen were you can see the option. And this is Prestashops own demo. http://postimg.org/image/p4n7rvqmv/

The option is called Enable product image on invoice. 

Or am I missing something here.  

Link to comment
Share on other sites

Which PS version ? I'm not using the latest for security reasons. I always wait some months and check if the version is working stable. Perhaps you found a bug. Latest really stable version for to use in production for me is 1.6.0.11.

Please report it to the debug tracker in here: http://forge.prestashop.com

Edited by selectshop.at (see edit history)
Link to comment
Share on other sites

good, now you have something to track the issue with. 

 

it was also reported in those comments that you can replace the PDF class with the one from PS 1.6.0.11 and it would work.  I haven't tested that, but something you can try if you really want product images to appear in the invoice

Link to comment
Share on other sites

  • 2 months later...

I found a solution using the link: https://github.com/PrestaShop/PrestaShop/pull/2797/files

Just check the highlighted code for each file to be modified, there are (-) for lines to be deleted and (+) for lines to be added or edited, I just copied the lines that need to be modified and pasted in the respected files in classes/pdf folder and everything is working right now.

I am using the 1.16.0.14 installation.

Edited by pritishnandi (see edit history)
  • Like 1
Link to comment
Share on other sites

this fix worked for me for download version, although the line numbers were not the same in the HTMLTemplateInvoice.php.

 

Error still exists on cloud however and will cause any instant payment method to crash the checkout with the tcpdf error.  To bypass the problem just uncheck to include image in invoice for now.  It crashes in checkout because when the order converts, the payment accepted status tells the store to send the invoice attached to the payment accepted.  This in turn throws the error as it generates the pdf to attach.

Link to comment
Share on other sites

Im on 1.6.0.14 - I added the changes so im seeing the images for the new order invoices and but still alot of old ones show the error.

 

My question is will it be ok for all new orders? also if I turn on / off Enable product image on Invoice my invoices still show images.

 

thanks

Edited by danfar (see edit history)
Link to comment
Share on other sites

  • 8 months later...

I found a solution using the link: https://github.com/PrestaShop/PrestaShop/pull/2797/files

Just check the highlighted code for each file to be modified, there are (-) for lines to be deleted and (+) for lines to be added or edited, I just copied the lines that need to be modified and pasted in the respected files in classes/pdf folder and everything is working right now.

I am using the 1.16.0.14 installation.

 

Hello, 

 

I just wanted to say thank you for posting your solution, it helped me fixing an issue for a client.

 

Best regards,

 

Julien

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...