共享首页推荐商品调用商品品牌方法

2016-07-07 15:34 来源:www.chinab4c.com 作者:ecshop专家

老大们呀!怎么ECSHOP论坛技术性问题那么难找到,不像DEDE发的问题很快就能解决,什么都还要自己解决
算了不说了,进正题,

1.includes/lib_goods.php 288行修改成,(红色是添加内容)
$sql = 'SELECT b.brand_name,g.goods_id,g.goods_sn, g.goods_name, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price,' .
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ".
"promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, g.goods_img, RAND() AS rnd " .
'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 ".
"ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]'";


2..includes/lib_goods.php 中 $goods[$idx]['brief']= $row['goods_brief'];下面添加一行
$goods[$idx]['brand_name']= $row['brand_name'];

3.首页index.dwt中 用{$goods.brand_name}调用

回答:
关注一下。

楼主动手能力强哦,怎么快就解决了。

留个脚印

不错,值得一试
留下足迹、

我是直接用{$goods.brand_name}就调用了呀,只不过商品列表页调不出

挺好的,收藏学习了~