ecshop后台管理显示扩展分类

时间:2023-03-08 16:15:30

ecshop 后台商品列表默认只显示分类下的商品,而不显示扩展分类中的商品,以下是我个人给出的解决方法: 
打开admin/includes/lib_goods.php 第839行左右的位置 可以看到如下代码:

$where = $filter['cat_id'] > 0 ? " AND " . get_children($filter['cat_id']) : ''; 

把以上这行代码的内容换成如下内容即可:

if($filter['cat_id']>0){
$cid = get_children($filter['cat_id']);
$where = " AND ($cid OR ".get_extension_goods($cid).")";
}else{
$where = "";
}

其中get_extension_goods函数是 获得所有扩展分类属于指定分类的所有商品ID,文件在/include/lib_goods.php里。需引入使用。