如何在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}
将
$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}
相关文章推荐
- 如何在ecshop商品列表页增加品牌及品牌链接显示的方法
- ecshop如何在商品列表页上增加库存显示
- ecshop商品列表页增加/显示货号SN
- ECSHOP商品列表页显示每个商品的品牌
- ECSHOP后台商品列表中增加商品属性的显示方法 .
- ECSHOP后台商品列表中增加商品属性的显示方法
- 在ECSHOP商品列表页显示每个商品的品牌
- ecshop实现商品列表页属性筛选区品牌筛选以LOGO形式展示
- ECSHOP 商品增加新字段的方法
- 如何在ecshop商品详情页显示供货商信息
- ecshop添加商品选择品牌时如何按拼音排序
- 修改ECSHOP后台的商品列表里显示该商品品牌
- ecshop商品列表页,循环显示当前分类的二级分类以及分类下的商品
- 如何增加外部链接 网站增加外部链接方法
- ecshop二次开发 之在商品分类页如何增加评论等级和评论数量
- ecshop 如何调整商品属性筛选项的显示顺序?
- 在ECSHOP商品列表页显示每个商品的评论等级和评论数量
- ecshop商品列表调用显示商品属性的方法
- [OK]ECSHOP后台的商品列表里显示商品品牌
- [OK]ECSHOP商品列表页显示每个商品的评论等级和评论数量