News:

Looking for documentation? Take a look on our wiki

Main Menu

SEF URL Menu and Sub Category Errors

Started by peteward15, April 22, 2015, 16:44:33 PM

Previous topic - Next topic

peteward15

Quote from: GJC Web Design on May 10, 2015, 22:37:04 PM

2.
Quotewww.ourdomainname.com/component/virtuemart/?Itemid=116

this means that somewhere in your install is a menu already set to this cat -- it has the Itemid of 116

look thru ALL your menu items (inc. trash and unpublished)  looking for this id number  (last column)

I have looked at what you have said and this is what I found.

In one example from the dropdown menu the link is correct and it is:  www.ourdomain.com/store-a-g/eks-engel-gmbh/fimp-patch-splice-box

This takes you to the correct subcategory.  However if you click the category eks engel and view the sub categories and click the sub cat fimp patch the destination URL becomes:

www.ourdomain.com/component/virtuemart/?Itemid=114

I have looked in the sites main drop down menu setup and sure enough the item ID for the menu item is indeed 114.   


erhabe

I think i know why i have this bug when i create menu sorted after category and manufacturer.
I disabled sef and i have this url for category
/index.php?option=com_virtuemart&view=category&virtuemart_category_id=8&virtuemart_manufacturer_id=4&categorylayout=0&showcategory=0&showproducts=1&productsublayout=0&Itemid=145&lang=ro

and this when i click on a product from that category
/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=130&virtuemart_category_id=8&Itemid=145&lang=ro

On router.php at productdetails

case 'productdetails';

$virtuemart_product_id = false;
if (isset($jmenu['virtuemart_product_id'][ $query['virtuemart_product_id'] ] ) ) {
$query['Itemid'] = $jmenu['virtuemart_product_id'][$query['virtuemart_product_id']];
unset($query['virtuemart_product_id']);
unset($query['virtuemart_category_id']);
} else {
if(isset($query['virtuemart_product_id'])) {
if ($helper->use_id) $segments[] = $query['virtuemart_product_id'];
$virtuemart_product_id = $query['virtuemart_product_id'];
unset($query['virtuemart_product_id']);
}
if(empty( $query['virtuemart_category_id'])){
$query['virtuemart_category_id'] = $helper->getParentProductcategory($virtuemart_product_id);
}
if(!empty( $query['virtuemart_category_id'])){
$categoryRoute = $helper->getCategoryRoute($query['virtuemart_category_id']);
if ($categoryRoute->route) $segments[] = $categoryRoute->route;
if ($categoryRoute->itemId) $query['Itemid'] = $categoryRoute->itemId;
else $query['Itemid'] = $jmenu['virtuemart'];
} else {
$query['Itemid'] = $jmenu['virtuemart']?$jmenu['virtuemart']:@$jmenu['virtuemart_category_id'][0];
}
unset($query['virtuemart_category_id']);

if($virtuemart_product_id)
$segments[] = $helper->getProductName($virtuemart_product_id);
}
break;


No Manufacturer string is located here.

On category

case 'category';
$start = null;
$limitstart = null;
$limit = null;

if ( isset($query['virtuemart_manufacturer_id'])  ) {
$segments[] = $helper->lang('manufacturer').'/'.$helper->getManufacturerName($query['virtuemart_manufacturer_id']) ;
unset($query['virtuemart_manufacturer_id']);
}
if ( isset($query['search'])  ) {
$segments[] = $helper->lang('search') ;
unset($query['search']);
}
if ( isset($query['keyword'] )) {
$segments[] = $query['keyword'];
unset($query['keyword']);
}
if ( isset($query['virtuemart_category_id']) ) {
$categoryRoute = $helper->getCategoryRoute($query['virtuemart_category_id']);
if ($categoryRoute->route) {
$segments[] = $categoryRoute->route;
}
if(isset($query['virtuemart_category_id']) and isset($jmenu['virtuemart_category_id'][$query['virtuemart_category_id']])) {
$query['Itemid'] = $jmenu['virtuemart_category_id'][$query['virtuemart_category_id']];
} else {
//http://forum.virtuemart.net/index.php?topic=121642.0
if (!empty($categoryRoute->itemId)) {
$query['Itemid'] = $categoryRoute->itemId;
} else {
$query['Itemid'] = vRequest::get('Itemid',false);
}
}
unset($query['virtuemart_category_id']);
}
if ( isset($jmenu['category']) ) $query['Itemid'] = $jmenu['category'];

if ( isset($query['orderby']) ) {
$segments[] = $helper->lang('by').','.$helper->lang( $query['orderby']) ;
unset($query['orderby']);
}

if ( isset($query['dir']) ) {
if ($query['dir'] =='DESC'){
$dir = 'dirDesc';
} else {
$dir = 'dirAsc';
}
$segments[] = $dir;
unset($query['dir']);
}

// Joomla replace before route limitstart by start but without SEF this is start !
if ( isset($query['limitstart'] ) ) {
$limitstart = $query['limitstart'] ;
unset($query['limitstart']);
}
if ( isset($query['start'] ) ) {
$start = $query['start'] ;
unset($query['start']);
}
if ( isset($query['limit'] ) ) {
$limit = $query['limit'] ;
unset($query['limit']);
}
if ($start !== null &&  $limitstart!== null ) {
//$segments[] = $helper->lang('results') .',1-'.$start ;
} else if ( $start>0 ) {
// using general limit if $limit is not set
if ($limit === null) $limit= vmrouterHelper::$limit ;

$segments[] = $helper->lang('results') .','. ($start+1).'-'.($start+$limit);
} else if ($limit !== null && $limit != vmrouterHelper::$limit ) $segments[] = $helper->lang('results') .',1-'.$limit ;//limit change

break;


On category strings for manufacturers are presents.
Does anyone know how to put manufacturer strings on productdetails case so the manufacturer name will be loaded on product url?