广州传奇网络
地址:广州市天河区东圃大马路富华楼C座
电话:13808825895
QQ:1564443073
ECSHOP后台的商品列表中显示商品品牌的具体方法
第一步:
首先我们来打开程序文件: /admin/includes/lib_goods.php
定位到 goods_list 函数部分
找到下面代码(大概在911行左右)
$sql = "SELECT goods_id, goods_name, goods_type, goods_sn, shop_price, is_on_sale, is_best, is_new, is_hot, sort_order, goods_number, integral, " . " (promote_price > 0 AND promote_start_date <= '$today' AND promote_end_date >= '$today') AS is_promote ". " FROM " . $GLOBALS['ecs']->table('goods') . " AS g WHERE is_delete='$is_delete' $where" . " ORDER BY $filter[sort_by] $filter[sort_order] ". " LIMIT " . $filter['start'] . ",$filter[page_size]"; |
将它修改为
ECSHOP后台的商品列表中显示商品品牌的具体方法
第二步:
修改 admin/templates/goods_list.htm 文件
找到
{$goods.goods_name|escape:html}
在它后面增加一行代码:
(品牌:{$goods.brand_name})
修改到这里,你会发现品牌是能显示出来了,但是搜索功能里的按品牌搜索却失效了。别着急,第三步就是来解决这个问题的。
ECSHOP后台的商品列表中显示商品品牌的具体方法
第三步(很重要):
向上,找到下面代码(大概在865行左右)
$where .= " AND brand_id='$filter[brand_id]'";
将它修改为
$where .= " AND g.brand_id='$filter[brand_id]'";