找到ecshop根目录下category.php文件 大概330行左右
// $smarty->assign('categories', get_categories_tree($cat_id)); // 分类树
$arr_categories_tree= get_categories_tree($cat_id);
$sql='SELECT count(*) FROM '.$ecs->table('category') ." WHERE parent_id = '$cat_id' AND is_show = 1 ";
if($db->getOne($sql)){
$smarty->assign('categories',array($cat_id=>$arr_categories_tree[$cat_id])); // 分类树
}else{
$smarty->assign('categories',array($cat['parent_id']=>$arr_categories_tree[$cat['parent_id']])); // 分类树
}
然后再模板下面调用
<div >
<div>商品分类:</div>
<ul>
<div >
<!--{foreach from=$categories item=cat}-->
<!-- {if $cat.cat_id}-->
<!--{foreach from=$cat.cat_id item=child}-->
<li><a href="{$child.url}">{$child.name}</a></li>
<!--{/foreach}-->
<!-- {/if} -->
<!--{/foreach}-->
</div>
</ul>
</div>
新闻热点
疑难解答