Adding an image to attachinvoice

  • Posts: 16
  • Thank you received: 0
11 years 7 months ago #66908

I am having difficulty adding an image to the attachinvoice. The image resides at www.dingospirit.net/images/invoice/Dingo_logo_rego_200.jpg

I have used the following in the invoice.php of attachinvoice:
<img src=" www.dingospirit.net/images/invoice/Dingo_logo_rego_200.jpg"/ >

This results in the invoice not being attached to the order_status_notification email when the order is changed to confirmed.

Without the <img src=.../> the invoice is attached to the confirmation email.

PS. I am using Joomla! version, 2.5.7

File Attachment:

File Name: invoice.txt
File Size:10 KB


Thanks,
Geoff

Attachments:

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

  • Posts: 83
  • Thank you received: 10
11 years 7 months ago #66910

<img src="/images/invoice/Dingo_logo_rego_200.jpg"/>

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

  • Posts: 16
  • Thank you received: 0
11 years 7 months ago #66923

Thanks for the quick reply. Unfortunately this resulted in the invoice not being attached to the confirmation email.

Geoff

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

  • Posts: 83
  • Thank you received: 10
11 years 7 months ago #66929

can you try removing the last back-slash

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

  • Posts: 16
  • Thank you received: 0
11 years 7 months ago #67049

Hi,

Unfortunately removing the back-slash has not fixed the problem either.

I had thought the problem might be linked to the fact that I'm using Joomla 2.5. I have read somewhere else on the forum that Hikashop is having some problems with linking data in the order_status_notification email. But I have managed to add the logo image to the order_status_notification email using:
<img src="images/invoice/Dingo_logo_rego_200.jpg"/>

Has anyone else placed an image on the attachinvoice?

Thanks,
Geoff

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

  • Posts: 83
  • Thank you received: 10
11 years 7 months ago #67055

hmmm....... I just tried, and I also can't include an image.

If there is no image, then the invoice attaches to the confirmed email. With an image, there is no attachment.

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

  • Posts: 83
  • Thank you received: 10
11 years 7 months ago #67056

scratch that,
I just got it to work, but I used the full url of the image including http: //www infront

(no spaces, it just won't let me type it in the forum)

Last edit: 11 years 7 months ago by jrod.

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

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
11 years 7 months ago #67079

Yes, you need to enter the full URL of the image as the PDF generation library that we're using cannot handle relative links.

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

  • Posts: 154
  • Thank you received: 4
9 years 8 months ago #167408

hi there, just found this post after trying for ages to attach the image...

i am using the full url like this:
<img src=" subdomain.domain.de/templates/templatename/images/logo.svg " alt="logo" height="100" width="120">
but getting still the following error:

6 ERROR n°6 : Impossible to load the image subdomain.domain.de/templates/templatename/images/logo.svg

(EDIT: in both URLs the h t t p : / / is of course included, it has been somehow stripped off this post...)

any idea what the trouble could be?
any help appreciated...

PS.
-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.0

Last edit: 9 years 8 months ago by olivnewton.

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

  • Posts: 26019
  • Thank you received: 4005
  • MODERATOR
9 years 8 months ago #167411

Hi,

As explained in the previous post, you have ot put a relative path, you should put an url (so, no domain name).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 9 years 8 months ago by Jerome.

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

  • Posts: 154
  • Thank you received: 4
9 years 8 months ago #167833

sorry, i dont understand this... the previous post from nicolas states clearly:

Yes, you need to enter the full URL of the image as the PDF generation library that we're using cannot handle relative links.


please clarify...
...put an url (so, no domain name)... ???
AFAIK a domain name is part of an URL

BTW: i tried also the following both
"/templates/templatename/images/logo.svg"
"templates/templatename/images/logo.svg"
i always get ERROR n°6 : Impossible to load the image h t t p : / / subdomain.domain.tld/templates/templatename/images/logo.svg

Last edit: 9 years 8 months ago by olivnewton.

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

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
9 years 8 months ago #167855

Hi,

The problem here is not the path of the image but the fact that you're trying to use a SVG image.
The version of TCPDF used by the plugin doesn't support SVG img tags properly as far as I can see.
Try to include it manually with the ImageSVG function as shown in this example:
www.tcpdf.org/examples/example_058.phps

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

  • Posts: 154
  • Thank you received: 4
9 years 8 months ago #167971

thanks for the suggestion, but before trying a blown up solution, i thought i could try using the PNG or JPG of the logo, which i also have in this folder. so here is a little sum-up of all my tests, none of them worked, no matter if SVG/PNG/JPG:

SVG:

<img src="http://subdomain.domain.tld/templates/templatename/images/logo.svg" alt="logo" height="100" width="120"/>
<img src="/templates/templatename/images/logo.svg" alt="logo" height="100" width="120"/>
<img src="templates/templatename/images/logo.svg" alt="logo" height="100" width="120"/>
PNG
<img src="http://subdomain.domain.tld/templates/templatename/images/logo.png" alt="logo" height="100" width="120"/>
<img src="/templates/templatename/images/logo.png" alt="logo" height="100" width="120"/>
<img src="templates/templatename/images/logo.png" alt="logo" height="100" width="120"/>
JPG
<img src="http://subdomain.domain.tld/templates/templatename/images/logo.jpg" alt="logo" height="100" width="120"/>
<img src="/templates/templatename/images/logo.jpg" alt="logo" height="100" width="120"/>
<img src="templates/templatename/images/logo.jpg" alt="logo" height="100" width="120"/>

...also tried all combinations without the slash at the end, ...width="120"> because i read somewhere in your forum this might cause trouble = again, it doesnt work either...

so i can say it is not due to the fact that i was trying to use a SVG...
any idea?

Last edit: 9 years 8 months ago by olivnewton.

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

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
9 years 8 months ago #167980

Relative links don't work so the fact that the two last tries don't work is normal.
For the URL, you need to make sure that the allow_url_fopen parameter of your php.ini is activated so that the images can be retrieved.
Also, what you can try is to enter the full path of the file on your web server. Something like that : /home/user/var/www/templates/templatename/images/logo.png

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

  • Posts: 154
  • Thank you received: 4
9 years 8 months ago #168207

i was confused by jeromes answer (...you have to put a relative path...) so i tried all possible solutions...

the /home/user/var/www/templates/templatename/images/logo.png did not work...
i tired to use it like this:
<img src="/home/user/var/www/templates/templatename/images/logo.png" />
because this didnt work i tried also this
<img src="home/user/var/www/templates/templatename/images/logo.png" />
and this
<img src=" subdomain.domain.tld/home/user/var/www/t...name/images/logo.png " />

(of course i changed in both cases "/home/user/var/www/" by the value i can see in joomla>system information>configuration file>log_path : ...obviously without "logs" at the end!

did a make a mistake???

tomorrow i can check if i can enable allow_url_fopen on the server, but only if it is possible to set allow_url_include to OFF!

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

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
9 years 8 months ago #168218

The first one is correct if you replaced the /home/user/var/www/ part. So I don't know why it wouldn't work.
Lets see with the normal URL subdomain.domain.tld/templates/templatename/images/logo.png and the allow_url_fopen option activated (you have have the other turned off of course).

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

  • Posts: 154
  • Thank you received: 4
9 years 8 months ago #168297

allow_url_fopen did the trick!

for anyone interested as short summary of how i got this to work:

-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.0
-- changed allow_url_fopen from OFF to ON
(add the line allow_url_fopen = On inside a php5.ini and save it in root)
ATTENTION!!! = for security reasons, be aware that allow_url_include should be set to OFF!!! (this should be the standard setting)
-- inside plugins/hikashop/attachinvoice/attachinvoice/invoice.php i used a relative path:

<img src="/templates/templatename/images/logo.png" />
-- the same works with a JPG
-- SVG unfortunately does not work, but nicolas posted a workaround i havent checked yet...

Last edit: 9 years 8 months ago by olivnewton.
The following user(s) said Thank You: Jerome

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

Time to create page: 0.130 seconds
Powered by Kunena Forum