ecshop前台定单详情里加图片

2016-09-07 22:03 来源:www.chinab4c.com 作者:ecshop专家

 台定单详情里加图片,打开文件 upload\\includes\\lib_order.php

 
找到函数function order_goods
 
修改代码return $GLOBALS['db']->getAll($sql); 为如下:
 
$arr = $GLOBALS['db']->getAll($sql);
 
 
    foreach ($arr as $key => $value)
    {
           /* 查询图片 */
        $sql = "SELECT goods_thumb FROM " . $GLOBALS['ecs']->table('goods') . " WHERE 
goods_id=" . $value['goods_id'];
        $arr[$key]['goods_thumb'] = $GLOBALS['db']->GetOne($sql);
    }
 
 
    return $arr;
 
然后保存,在模板中调用<img src="{$goods.goods_thumb}" width="60" height="60" />
(责任编辑:chinab4c)