News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

How to fix relative image url for custom field "image" in html email? VM2.0

Started by design609, January 26, 2012, 01:06:40 AM

Previous topic - Next topic

design609

Hi
I see relative url on custom field option (field type image) in the customers order email and in admin's.
How to fix so there is a absolute url - so image can be seen?
eg.
Productname
Color: [broken image] Grey

do not know how to fix it in file:
/cart/mail_html_pricelist.php

<td align="left" ><?php echo JHTML::link$root.$prow->url$prow->product_name).$prow->customfields?></td>



Cheers

stAn99

Hello, i guess it can be changed this way inside the php tags:

<?php
echo '<a href="'.JURI::base().'/'.JRoute::_($root.$prow->url).'">'.$prow->product_name.'</a>'.$prow->customfields;
?>

i am not sure now if JURI::base returns / at the end or not at the moment. This also must be triggered from a default html layout as some poor sef extensions don't handle the url correctly when in other layouts.
----
RuposTel.com
www.rupostel.com
Your customized checkout solution for Virtuemart

design609

Hi stAn99

Thanks, I tried it out but I still only get relative url.

I only use Joomla SEF as my aceSEF component not work well with VM2 (as they state that VM runs outside the router ... or something like that...)
I guess that might be why the JURI::base().'/ is not drawn in.

And funny thing is that the vendor logo have absolute path, but guess devs missed somebody adding an image to their product would not show in email.
I hope Dev might have an input.


HMTL FORM EMAIL (last with modified code):

<div class="vm-customfield-cart"> <span class="product-field-type-M">Farve : <img src="/images/stories/virtuemart/product/resized/japansk_crepe_lavendel_80x128.jpg" alt="japansk_crepe_lavendel.jpg"  /><span class="vm-img-desc">Lavendel</span></span></span></div>            
            <br/>test<br/>
<span class="product-field-type-M">
Farve :
<img src="/images/stories/virtuemart/product/resized/japansk_crepe_lavendel_80x128.jpg" alt="japansk_crepe_lavendel.jpg"  />
<span class="vm-img-desc">Lavendel</span></span></span></div>

[attachment cleanup by admin]

Studio 42

Hi,
The problem is that the function use always the relative path.
You cannot change something on a simple way.

In internal use , this is preferred, but sure in mail or RSS feed this can be a problem
We look to provide the best solution and not a simple hack on this place.
Thanks for your report.

design609

Thanks Electrocity
for looking at it.
I understand the complexity.

So for now I just go with
Give my custom field image a "Displayed image title" in Media Files.
This way the customer can see the image and title on the frontend (productpage and  cart)
Then in mails I make a override of :
/templates/mytemplate/html/com_virtuemart/cart/mail_html_pricelist.php

Placing inline styling in the upper part of the html
<style>
.vm-customfield-cart img{
display:none !important;}</style>


This way eliminating the display of the broken images. Leaving only the "Displayed image title" to be seen for admin and customer.
So the mail looks prof.

SIDE NOTE:::::::::::::::: VM2.0 | J1.5.25
Unfortunaly I still have the problem of:
QuoteWarning: key() [function.key]: Passed variable is not an array or object in /home/dan23191/public_html/dev/administrator/components/com_virtuemart/plugins/vmcustomplugin.php on line 253

Warning: key() [function.key]: Passed variable is not an array or object in /home/dan23191/public_html/dev/administrator/components/com_virtuemart/plugins/vmcustomplugin.php on line 253

in admin's -> view order
and in customer's "View this order online"

I know this is fixed in VM2.0.1 - but as there is other issues with that pre-release (especially in the email / order & Custom fields section) I have to stay on VM2.0.
So I also remove all reference to the link "View this order online" and the shopadmin then must rely on mails to know which colour variant was chosen.


EDIT NOTE:::::::::::::::: VM2.0 | J1.5.25
This above code suggestion only reference to VM2.0 NOT the later sub-releases!