VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: EvanGR on September 12, 2018, 08:57:28 AM

Title: SEF product URL?
Post by: EvanGR on September 12, 2018, 08:57:28 AM
I am trying to get the canonical URL for a product, like so:

$productCanonicalUrl = JURI::root() . $this->product2->canonical;

It works, but I get the complex (non-SEF) URL structure: index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=543&virtuemart_category_id=42

How can I get the SEF version of that?

Note that I want to insert the SEF URL into my own html link element, and not use Joomla function to create the link for me.

Thanks

Title: Re: SEF product URL?
Post by: Ghost on September 12, 2018, 09:13:08 AM
JRoute::_($this->product2->canonical)