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

Posted on 2014-08-01
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
    LVL 58

    Expert Comment

    Try prepending JURI::root()

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

    Open in new window


    Author Comment

    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:<a href="/en/category/sub-category/product-name.html">Product Name</a>
    but I need this:  
    <a href="">Product Name</a>

    Author Comment

    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

    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

    Thanks so much for your help Gary, worked great.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Read about how to choose the best possible content marketing agency to suit your needs. Content marketing has become an integral part of running a successful tech business, so it is wise to be informed.
    Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now