I've just started reorganizing one of my websites products categories which relies heavily on the order of the categories for SEO purposes. in the SEO URLs config options there is an option in there that says" Add category parent to begining of URLs?" which I have set to true. in the past I've only have 2 levels of categories so it behaved as expected creating URLs as such:
http://webiste.com/main-category-sub-category1-c-1.html however I've added another level of categories and would like the URL to read as such:
http://webiste.com/main-category-sub-category1-sub-category2-c-1.html
but I'm getting:
http://webiste.com/sub-category1-sub-category2-c-1.html it only pulls in the parents category name one level up.. not all the way to the top. I have found in the seo.class.php file the following code which I believe controls this url structure which reads as so:
case ($this->attributes['SEO_ADD_CAT_PARENT'] == 'true'):
$sql = "SELECT c.categories_id, c.parent_id, cd.categories_name as cName, cd2.categories_name as pName
FROM ".TABLE_CATEGORIES." c
JOIN ".TABLE_CATEGORIES_DESCRIPTION." cd
ON c.categories_id = cd.categories_id
LEFT JOIN ".TABLE_CATEGORIES_DESCRIPTION." cd2
ON c.parent_id=cd2.categories_id AND cd2.language_id='".(int)$this->languages_id."'
WHERE c.categories_id='".(int)$single_cID."'
AND cd.categories_id='".(int)$single_cID."'
AND cd.language_id='".(int)$this->languages_id."'
LIMIT 1";
$result = $this->DB->FetchArray( $this->DB->Query( $sql ) );
$cName = $this->not_null($result['pName']) ? $result['pName'] . ' ' . $result['cName'] : $result['cName'];
break;
Can anyone help me modify the code so the URL structure is what I'm needing? Thanks ahead of time for the help