I always like keeping processing in php when possible.
Open home.php
FIND:
Code:
require $xcart_dir."/include/categories.php";
AFTER ADD:
Code:
// WCM - Get Root Cat (customization)
$wcmRootCat = func_query_first("SELECT categoryid,category FROM $sql_tbl[categories] WHERE categoryid='" . (int)current(explode('/',($current_category['categoryid_path']))) . "'");
$current_category['root_categoryid'] = $wcmRootCat['categoryid'];
$current_category['root_category'] = $wcmRootCat['category'];
$smarty->assign('current_category',$current_category);
// / WCM - Get Root Cat (customization)
In your template use:
Code:
{if $current_category.root_categoryid eq X}
The root category for this is: {$current_category.root_category}.
{else}
Something else
{/if}