Chinaunix首页 | 论坛 | 博客
  • 博客访问: 151436
  • 博文数量: 89
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 70
  • 用 户 组: 普通用户
  • 注册时间: 2016-06-29 23:10
文章分类

全部博文(89)

文章存档

2016年(89)

我的朋友

分类: Web开发

2016-03-29 21:34:58

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

1.先打开 includes/lib_order.php

找到 (大概是在873行)

$arr[$key]['formated_subtotal']     = price_format($value['subtotal'], false);

在它的下面增加以下代码

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

2.下面这一步千万要认真,不能马虎,还是在includes/lib_order.php

先找到 get_cart_goods() 函数部分,然后再找到此函数中的一行代码

$goods_list[] = $row;

(注:此行代码在includes/lib_order.php中出现了两次,千万别找错了)

找到这行代码后,在它上面增加以下代码

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

3.修改 模板文件 flow.dwt 文件

找到

({$lang.free_goods})

在他后面增加代码

{$goods.goods_brand}

找到


在它后面增加代码

品牌:{$goods.goods_brand}

转载自:

阅读(676) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~