Author Topic: Get current page URL, without the parameters?  (Read 282 times)

EvanGR

  • Jr. Member
  • **
  • Posts: 180
Get current page URL, without the parameters?
« on: January 08, 2019, 12:25:07 pm »
Hello,

I want to get the current page URL, excluding the parameters...
e.g. /mycategory/mysubcategory?param=1
The above, without the bold part.

Reason: I want to create custom page variation links with my own parameters.

I want to do it from the product category view file, if that makes any difference (it shouldn't).

Any ideas?

Thanks

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2842
  • VirtueMart Version: 3.4
Re: Get current page URL, without the parameters?
« Reply #1 on: January 08, 2019, 13:16:23 pm »
regards
A

Joomla 3.9.1
php 7.1

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10312
  • VirtueMart Version: 3+
Re: Get current page URL, without the parameters?
« Reply #2 on: January 08, 2019, 22:41:50 pm »
$jinput = JFactory::getApplication()->input;
$category=$jinput->getInt('virtuemart_category_id', 0);


 $category_url = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category , FALSE);
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

I do NOT do development work for hire.

EvanGR

  • Jr. Member
  • **
  • Posts: 180
Re: Get current page URL, without the parameters?
« Reply #3 on: January 09, 2019, 08:53:46 am »
Thank you!