ecshop订单中心显示缩略图的办法

更新时间:2021-06-01 点击量:2754

ecshop用户中心 >> 我的订单 >> 查看订单详细,要如何加入商品缩略图呢??


1、修改 includes/lib_order.php ,找到 order_goods 函数部分,大概在467行左右

 $sql = "SELECT rec_id, goods_id, goods_name, goods_sn, market_price, goods_number, " .
             "goods_price, goods_attr, is_real, parent_id, is_gift, " .
             "goods_price * goods_number AS subtotal, extension_code " .
             "FROM " . $GLOBALS['ecs']->table('order_goods') .
            " WHERE order_id = '$order_id'";


替换为

 $sql = "SELECT og.rec_id, og.goods_id, og.goods_name, og.goods_sn, og.market_price, og.goods_number, " .
             "og.goods_price, og.goods_attr, og.is_real, og.parent_id, og.is_gift, " .
             "og.goods_price * og.goods_number AS subtotal, og.extension_code,g.goods_thumb " .
             "FROM " . $GLOBALS['ecs']->table('order_goods') . " AS og ".
    " LEFT JOIN ". $GLOBALS['ecs']->table('goods') . " AS g on og.goods_id=g.goods_id " .
            " WHERE order_id = '$order_id'";

2、修改 user_transaction.dwt 文件,


<th width="29%" bgcolor="#ffffff">{$lang.goods_attr}</th>
上面增加一行代码
<th  align="center" bgcolor="#ffffff">缩略图</th>

紧接着在
<td bgcolor="#ffffff">{$goods.goods_attr|nl2br}</td>
上面增加一行代码
<td bgcolor="#ffffff"><img src="/{$goods.goods_thumb}" ></td>
3、这样应该就可以了,以上第2步修改(模板修改)是在官方默认模板下进行的,如果您使用的是其他模板,请对照着添加即可!



支付宝扫码打赏 微信打赏

如果文章对您有帮助,就打赏一个吧

在线客服

客户服务

热线电话:

13128985956 服务时间:

周一到周六:9:00-18:00

在线QQ客服

在线微信客服

关于我们 常见问题

支付方式 加盟合作

提交需求
优惠红包 购物车0 反馈留言 返回顶部