Unable to add logo to PDF Invoice

  • Posts: 60
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
1 month 3 days ago #321766

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.1

While looking through multiple forums, the result was that I had to add an html img tag to the invoice.php file, I did that however it still doesn't display.
For clarity reasons I have added 2 images, one of the code inside invoice.php and the other of what the pdf invoice looks like.





Thank you in advance!

Kind regards.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 70194
  • Thank you received: 10508
  • MODERATOR
1 month 2 days ago #321769

Hi,

This invoice.php is the one in administrator/components/com_hikashop/views/order/tmpl/
However, I can see that you're using the PDF invoice plugin, which instead uses the invoice.php file in plugins/hikashop/attachinvoice/attachinvoice/
So it seems you're not editing the correct file.
Edit the correct one (via FTP, or your file manager) and it will work.

Please Log in or Create an account to join the conversation.

  • Posts: 60
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
1 month 1 day ago #321848

Hi,

I have somewhat resolved the issue, I can now place a logo into the invoice, however when I try to add an image that is placed in the server of the website, it gives an error in Joomla:



But when I use an external link of an image from another website, the invoice works correctly. Any Idea as to what the source of the issue is?

Kind regards,

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 2647
  • Thank you received: 348
  • MODERATOR
1 month 19 hours ago #321852

Hello,

This kind of error is very general, but most often that means that for a reason or another your image isn't accessible for your server...
Can't say much more from this...
But you can check that the server is able to use PHP's file_get_contents or cURL to download the file. "Unable to get the size of the image" is the first error in the Image function that TCPDF will throw if the file is unaccessible to both of those functions on the server.

Sorry, not sure this will be enough to explain well situation, but can't say much more about this.
Regards

Last edit: 1 month 1 day ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 60
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
4 weeks 7 hours ago #321947

Hi,
I am communicating with technical services, however they ask which php code grabs the images. So I would like to ask you if you could show an image of the php code that grabs the images. Frankly I don't have much experience with PHP and don't know where to look.

Thank you in advance.
Regards

Please Log in or Create an account to join the conversation.

  • Posts: 70194
  • Thank you received: 10508
  • MODERATOR
4 weeks 9 minutes ago #321955

Hi,

It's the code from the function Image in the file plugins/hikashop/attachinvoice/vendor/tecnickcom/tcpdf/tcpdf.php
More specifically, it's this code which tries to get the size of the image:

$imsize = @getimagesize($file)
What you can try is to use the absolute path of the image file on your server. That way, the TCPDF library we're using in the plugin won't have to download the image as it will already be on the server and will directly use it.

Please Log in or Create an account to join the conversation.

  • Posts: 60
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
2 weeks 6 days ago #322198

Hi again,

With the help of the technical service I have resolved the issue where it gives an error in Joomla, however now it won't show the logo image same as before. I have added the html tag to the file invoice.php


Do you have any idea what the issue this time could be?

Kind regards,

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 12482
  • Thank you received: 1716
  • MODERATOR
2 weeks 5 days ago #322203

Hello,

What do you exactly mean by :

however now it won't show the logo image same as before


We'll need more information through some screenshots for example, to properly understand and advise you, thank you.

Kind regards,
Mohamed.

Please Log in or Create an account to join the conversation.

Time to create page: 0.081 seconds
Powered by Kunena Forum