给ecshop报价单加上商品图片

1.打开根目录quotation.php文件
将以下代码
$sql = "SELECT g.goods_id, g.goods_name, g.shop_price, g.goods_number, c.cat_name AS goods_category,p.product_id,p.product_number,p.goods_attr". " FROM " . $ecs->table('goods') . " AS g LEFT JOIN " . $ecs->table('category') . " AS c ON g.cat_id = c.cat_id LEFT JOIN ".$ecs->table('products')."as p On g.goods_id=p.goods_id" . $where . " AND is_on_sale = 1 AND is_alone_sale = 1 "; $goods_list = $db->getAll($sql); 
修改为
$sql = "SELECT g.goods_id, g.goods_name, g.goods_thumb, g.shop_price, g.goods_number, c.cat_name AS goods_category,p.product_id,p.product_number,p.goods_attr".
    " FROM " . $ecs->table('goods') . " AS g LEFT JOIN " . $ecs->table('category') . " AS c ON g.cat_id = c.cat_id LEFT JOIN ".$ecs->table('products')."as p  On g.goods_id=p.goods_id" . $where . " AND is_on_sale = 1 AND is_alone_sale = 1 ";
    $goods_list = $db->getAll($sql);
    if($goods_list){
    foreach($goods_list as  $k => $v){
    $goods_list[$k]['thumb'] =   get_image_path($v['goods_id'], $v['goods_thumb'],true);
    }
    }
2.打开/data/quotation_print.html文件
调用加入以下代码
<th>图片地址</th>
<td style="text-align:center">
<a href=goods.php?id={$goods.goods_id} target='_blank'><img src="{$goods.thumb}" border=0 width=50 height=50></a>
</td>

本文原创地址:https://www.ecshop.cx/article-68.html
版权所有 © 转载时必须以链接形式注明出处!

觉得本文对您有用,想收藏下来!方法很简单:请点击-〉
我们一直坚持白天工作、晚上熬夜更新资源,付出了巨大的精力和时间,其中的辛酸难以言述。

实时购买动态 ×

诺丽王会员 在 2019-10-12 购买了 ecshop一键分享到第三方网站支持分成链接