Author Topic: SEF product URL?  (Read 162 times)

EvanGR

  • Jr. Member
  • **
  • Posts: 144
SEF product URL?
« on: September 12, 2018, 08:57:28 am »
I am trying to get the canonical URL for a product, like so:

Code: [Select]
$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


Ghost

  • Jr. Member
  • **
  • Posts: 416
Re: SEF product URL?
« Reply #1 on: September 12, 2018, 09:13:08 am »
Code: [Select]
JRoute::_($this->product2->canonical)