ecshop用户中心我的订单列表中显示商品缩略图

2016-07-07 14:55 来源:www.chinab4c.com 作者:ecshop专家

在ecshop用户中心我的订单列表中显示商品缩略图
注意此教程以 ECSHOP官方默认模板(2.7.2 版)为例进行讲解。

1)、

首先我们来打开 /includes/lib_transaction.php 文件

找到 get_user_orders 函数部分,

将下面代码

$arr[] = array('order_id' => $row['order_id'],
'order_sn' => $row['order_sn'],
'order_time'=> local_date($GLOBALS['_CFG']['time_format'], $row['add_time']),
'order_status'=> $row['order_status'],
'total_fee'=> price_format($row['total_fee'], false),
'handler'=> $row['handler'],

修改为:

$row['thumb'] =$GLOBALS['db'] ->getOne("select goods_thumb from".
$GLOBALS['ecs']->table("goods").
"where goods_id =(select goods_id from".
$GLOBALS['ecs']->table("order_goods").
"where order_id=".$row['order_id'].")");
http://titylc77.com
http://ewinylc51.com
http://**yulc67.com

$arr[] = array('order_id' => $row['order_id'],
'order_sn' => $row['order_sn'],
'order_time'=> local_date($GLOBALS['_CFG']['time_format'], $row['add_time']),
'order_status'=> $row['order_status'],
'total_fee'=> price_format($row['total_fee'], false),
'handler'=> $row['handler'],
'thumb' => $row['thumb']);