Ecshop首页分类调出排序、关键字、分类描述

作者: dreamfly 分类: ecshop 发布时间: 2015-04-12 20:13

在includes/lib_goods.php中找到

1
2
3
4
5
/* 分类信息 */
    $sql 'SELECT cat_name FROM ' $GLOBALS['ecs']->table('category') . " WHERE cat_id = '$cat_id'";
    $cat['name'] = $GLOBALS['db']->getOne($sql);
    $cat['url']  = build_uri('category'array('cid' => $cat_id), $cat['name']);
    $cat['id']   = $cat_id;

替换为

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* 分类信息 */
    $sql 'SELECT cat_name,keywords,cat_desc,sort_order FROM ' $GLOBALS['ecs']->table('category') . " WHERE cat_id = '$cat_id'";
 $res$GLOBALS['db']->getAll($sql);
    
 $cat array();
    foreach ($res AS $row)
    {
        $cat['name']                 = $row['cat_name']; //分类名称
        $cat['keywords']          = $row['keywords'];  //关键字
        $cat['cat_desc']           = $row['cat_desc'];  //分类描述
        $cat['sort_order']        = $row['sort_order'];  //排序
    }
  
    $cat['url']  = build_uri('category'array('cid' => $cat_id), $cat['name']);
    $cat['id']   = $cat_id;  //分类ID

然后在 cat_goods.lbi 中调用 {$goods_cat.keywords}----{$goods_cat.id}----{$goods_cat.name}----{$goods_cat.sort_order}

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

评论已关闭!