News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Virtuemart 3.0.3 canonical URL bug

Started by konserv, January 19, 2015, 06:11:56 AM

Previous topic - Next topic

konserv

There are some bugs with category page canonical URLs:

Bug #1: There are 2 canonical URLs - first is added by Joomla SEF plugin, second - by Virtuemart View (\components\com_virtuemart\views\category\view.html.php).
To fix this need to "connect" virtuemart and plugin. I think, it uses router.php to generate URL, we need to look in router.

I have disabled this plugin, but the the second URL is wrong.

Bug #2: The Virtuemart SEF url in view is wrong - there is "manufacturer" suffix (in my case - translated).
The problem is in function setCanonicalLink:

Original file:

$link = 'index.php?option=com_virtuemart&view=category';
if($categoryId!==-1){
$link .= '&virtuemart_category_id='.$categoryId;
}
if($manId!==-1){
$link .= '&virtuemart_manufacturer_id='.$manId;
}


Fixed file:
$link = 'index.php?option=com_virtuemart&view=category';
if(($categoryId!==-1)&&($categoryId!=0)){
$link .= '&virtuemart_category_id='.$categoryId;
}
if(($manId!==-1)&&($manId!=0)){
$link .= '&virtuemart_manufacturer_id='.$manId;
}




[attachment cleanup by admin]

sandstorm

#1
These bugs are still present in VM3.0.6 & not just in category pages as also discussed here - http://forum.virtuemart.net/index.php?topic=127441.0

I tested with Joomla 3.4RC & VM3.0.6 and 2 canonical URLS still show there.

Is there a best practice workaround or override, that anybody can suggest?

J3.6.4 / PHP7.0.12
VM3.0.16

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum