商品分类树需要始终显示所有类别,默认的Ecshop的显示方式为在当前产品页面只显示当前的产品所在的同级及下级分类,这就导致当点开某个产品或者子分类的时候全局的分类树就不见了。其实修改的方法很简单。
只需要分别将goods.php和category.php文件中的
1 | $smarty->assign('categories', get_categories_tree($goods['cat_id'])); |
改为:
1 | $smarty->assign('categories', get_categories_tree()); |
就可以。修改可以使用搜索进行。其中,在category.php中为$cat_array = get_categories_tree($c_id);