Need full URL displayed in email notice to customer in Virtuemart (Joomla)

Posted on 2014-08-01
Medium Priority
Last Modified: 2014-08-07
An email goes out to customer and store admin when order is placed which has a hyperlink to the product on the website , but the link is broken because it only contains the relative url.   I need it to show the full URL so it's clickable from the email.  I have found the php file that needs to be changed which has this line:
 <?php echo JHTML::link($prow->url, $prow->product_name) . $prow->customfields; ?>
So i what i don't know is where it's pulling the url from and how to adjust it to show the full url.
Question by:hthrp
  • 3
  • 2
LVL 58

Expert Comment

ID: 40235517
Try prepending JURI::root()

 <?php echo JURI::root().JHTML::link($prow->url, $prow->product_name) . $prow->customfields; ?>

Open in new window


Author Comment

ID: 40239466
Thanks so much for your response.  That was pretty close, however, what it did was to put the root URL in front of the text that was hyperlinked.   So clicking on link in email ends up with the same result.  I need the full url as a link.  
What I got was this:  
 http://rooturl.com/<a href="/en/category/sub-category/product-name.html">Product Name</a>
but I need this:  
<a href="http://rooturl.com/en/category/sub-category/product-name.html">Product Name</a>

Author Comment

ID: 40245244
I had a hunch this was not too difficult, but I'm still hunting for a solution.   I just don't know php to fix it.    The original file the code is on can be found at components/com_virtuemart/views/cart/tmpl/default_pricelist.php  but it currently is loading from a custom override file in the template.    Really need a solution.   Willing to hire someone who can fix this for me.
LVL 58

Accepted Solution

Gary earned 1600 total points
ID: 40246072
Documentation is seriously lacking

Either try
<?php echo JHTML::link(JURI::root() . $prow->url, $prow->product_name) . $prow->customfields; ?>

<a href="<?php echo JURI::root().$prow->url?>"><?php echo $prow->product_name?></a>

Author Closing Comment

ID: 40246521
Thanks so much for your help Gary, worked great.

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
Suggested Courses
Course of the Month14 days, 8 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question