ECSHOP首页调用指定商品分类下级子分类导航
2016-06-13 13:05 来源:www.chinab4c.com 作者:ecshop专家
在文件 includes/lib_goods.php 最后加上 //*** 调用商品分类指定分类下级分类 function get_parent_id_tree($parent_id) { $three_c_arr = array(); $sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('category') . " WHERE parent_id = '$parent_id' AND is_show = 1 "; if ($GLOBALS['db']->getOne($sql)) { $child_sql = 'SELECT cat_id, cat_name, parent_id, is_show ' . 'FROM ' . $GLOBALS['ecs']->table('category') . "WHERE parent_id = '$parent_id' AND is_show = 1 ORDER BY sort_order ASC, cat_id ASC"; $res = $GLOBALS['db']->getAll($child_sql); foreach ($res AS $row) { if ($row['is_show']) $three_c_arr[$row['cat_id']]['id'] = $row['cat_id']; $three_c_arr[$row['cat_id']]['name'] = $row['cat_name']; $three_c_arr[$row['cat_id']]['url'] = build_uri('category', array('cid' => $row['cat_id']), $row['cat_name']); } } return $three_c_arr; } 如图: 声明后用$smarty调用,就是在index.php中加上下面一句: $smarty->assign('get_parent_id16_tree', get_parent_id_tree(16));//调用父级分类6的下级分类 最后就可以在index.dwt模板文件里开始调用了 {$list.name|truncate:15:true} |
最近更新
常用插件
- ecshop按分类筛选销售排行
ecshop按分类筛选销售排行...
- ecshop二次开发售后维修卡
插件介绍: 本插件是用于专门从事电子,信息,软件等售后服务关键比...
- ecshop快递发货单打印商品
ecshop快递发货单打印商品信息,大家都知道ecshop快递单打印的时候,只能...
- ecshop选择下单时间插件
ecshop选择下单时间插件主要是根据不同的下单配送要求,在ecshop购物车...
- ecshop供应商插件免费下载
ecshop供应商插件免费下载...