VirtueMart Forum

VirtueMart 2 + 3 + 4 => Security (https) / Performance / SEO, SEF, URLs => Topic started by: GuidoS on January 02, 2014, 16:30:31 PM

Title: canonical category view manufacturer
Post by: GuidoS on January 02, 2014, 16:30:31 PM
I always get a canonical url to my virtuemart frontpage when I am on the category view for manufacturers. I think this comes because of the following code in the view.html.php of the category.


$categoryId = JRequest::getInt('virtuemart_category_id', false);
$virtuemart_manufacturer_id = JRequest::getInt('virtuemart_manufacturer_id', false );
if ($categoryId === false and $virtuemart_manufacturer_id === false){

$categoryId = ShopFunctionsF::getLastVisitedCategoryId();
$catType = 'category';
$this->setCanonicalLink($tpl,$document,$categoryId,$catType);
} else if ($categoryId === false and $virtuemart_manufacturer_id){

$catType = 'manufacturer';
$this->setCanonicalLink($tpl,$document,$virtuemart_manufacturer_id,$catType);
} else {
$catType = 'category';
$this->setCanonicalLink($tpl,$document,$categoryId,$catType);
}

if($categoryId!==-1){
$vendorId = 1;
$category = $categoryModel->getCategory($categoryId);
}


$categoryId = JRequest::getInt('virtuemart_category_id', false); is returning '0' en that means that


} else {
$catType = 'category';
$this->setCanonicalLink($tpl,$document,$categoryId,$catType);
}


will be executed and category 0 is not presented. Can some one confirm this?
Title: Re: canonical category view manufacturer
Post by: GuidoS on January 03, 2014, 14:44:05 PM
Isn't it strange to use getInt and try to return a boolean? Nobody else who has the problem that there is a wrong canonical url for a category page of manufacturer products?
Title: Re: canonical category view manufacturer
Post by: konserv on January 19, 2015, 08:43:22 AM
The problem is remaining.
I found the solution: http://forum.virtuemart.net/index.php?topic=127772.msg438292#msg438292

Please, try and say result.