To show the parent of a subcategory:
Open home.php
FIND:
Code:
require $xcart_dir."/include/categories.php";
AFTER ADD:
Code:
// WCM - Get Parent Cat (customization)
$wcmParentCat = func_query_first("SELECT categoryid,category FROM $sql_tbl[categories] WHERE categoryid='" . (int)$current_category['parentid'] . "'");
$current_category['parent_categoryid'] = $wcmParentCat['categoryid'];
$current_category['parent_category'] = $wcmParentCat['category'];
$smarty->assign('current_category',$current_category);
// WCM - Get Parent Cat (customization)
In your template use:
Code:
{if $current_category.parent_categoryid gt 0}
The parent category for this is: <a href="home.php?cat={$current_category.parent_categoryid}">{$current_category.parent_category}</a>.
{/if}