ECShop只显示当前分类与其子分类的代码
// $smarty->assign('categories', get_categories_tree($cat_id)); // 分类树
修改为:
// $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']])); // 分类树
}
- 最新评论