在购物车或结算页面显示商品的品牌

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



1、修改 includes/lib_order.php 文件
找到 cart_goods() 函数部分
找到
  1. $arr[$key]['formated_subtotal']= price_format($value['subtotal'], false);
复制代码
(大概在873行)
在它下面增加下面代码
  1. $sql="select brand_name from ".$GLOBALS['ecs']->table('goods')." g left join " . $GLOBALS['ecs']->table("brand") . " b ong.brand_id=b.brand_id where goods_id='{$value['goods_id']}'";
  2. $goods_brand = $GLOBALS['db']->getOne($sql);
  3. $arr[$key]['goods_brand']=$goods_brand;
复制代码
找到 get_cart_goods() 函数部分
找到
  1. $goods_list[] = $row;
复制代码
(大概在1603行)
在它上面增加下面代码
  1. $sql="select brand_name from ".$GLOBALS['ecs']->table('goods')." g left join " . $GLOBALS['ecs']->table("brand") . " b ong.brand_id=b.brand_id where goods_id='{$row['goods_id']}'";
  2. $goods_brand = $GLOBALS['db']->getOne($sql);
  3. $row['goods_brand']=$goods_brand;
复制代码
2、修改 模板文件 flow.dwt 文件
找到
  1. <!-- {if $goods.is_shipping} -->(<span style="color:#FF0000">{$lang.free_goods}</span>)<!-- {/if} -->
复制代码
在他后面增加代码
{$goods.goods_brand}

找到
  1. <a href="goods.php?id={$goods.goods_id}" target="_blank"><img src="{$goods.goods_thumb}" border="0" title="{$goods.goods_name|escape:html}" /></a><br />
复制代码
在它后面增加代码
(品牌:{$goods.goods_brand})

回答:
顶....啊顶.....

支持~~

$sql="select brand_name from ".$GLOBALS['ecs']->table('goods')." g left join " . $GLOBALS['ecs']->table("brand") . " b ong.brand_id=b.brand_id where goods_id='{$value['goods_id']}'";

{$value['goods_id']}'?????????????????

留下脚印 以后备用

我找了半天,也没有找到在首页调用flow.php这个页面的信息