您的位置:首页 > 运维架构

如何在ecshop商品列表页增加品牌及品牌链接显示的方法

2015-04-25 09:35 381 查看
1、打开category.php文件

$sql = 'SELECT g.goods_id, g.goods_name, g.goods_name_style,
g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price AS
org_price, ' .
改为
$sql = 'SELECT g.goods_id,g.brand_id,b.brand_name,b.brand_id, g.goods_name, g.goods_name_style, g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price AS org_price, ' .
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, g.promote_price, g.goods_type, " .
'g.promote_start_date, g.promote_end_date, g.goods_brief, g.goods_thumb , g.goods_img ' .
'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g ' .
'LEFT JOIN ' . $GLOBALS['ecs']->table('brand') . ' AS b ON b.brand_id = g.brand_id ' .
'LEFT JOIN ' . $GLOBALS['ecs']->table('member_price') . ' AS mp ' .

$arr[$row['goods_id']]['name'] = $row['goods_name'];
下增加一行
$arr[$row['goods_id']]['brand_name'] = $row['brand_name'];
$arr[$row['goods_id']]['brand_id'] = $row['brand_name'];
2、修改 themes/default/library/goods_list.lbi
在你想要显示品牌的地方加入 {$goods.brand_name}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息