如何解决订单显示图片(2.62版本)

2016-07-07 15:32 来源:www.chinab4c.com 作者:ecshop专家



查询了半天,自己想了半天,最后问了巴巴牛,然后用了半个小时解决了。下面把这些分享给大家。再次感谢巴巴牛朋友
---------------
大概思路是这样的,
goods_list数组里,并不存在goods_thumb,只需要在查询的时候把goods_thumb查询出来放入goods_list数组就搞定了。


-------
需要修改的文件有:order.php(admin目录下)和order_print.html(data目录下)

1.首先打开order.php
查询下列代码

  1. $sql = "SELECT o.*, g.goods_number AS storage, o.goods_attr, IFNULL(b.brand_name, '') AS brand_name " .
复制代码
查询之后把这个代码替换成

  1. $sql = "SELECT o.*,g.goods_thumb, g.goods_number AS storage, o.goods_attr, IFNULL(b.brand_name, '') AS brand_name " .
复制代码
保存就可以了。有3条要替换的,不知道你们的是多少条!

2.打开order_print.html

  1. <div align="center"><img height="120" alt="" width="120" src="/路径/{$goods.goods_thumb}" /></div>
复制代码
注意路径是指你的网站安装目录是不是本地,如果是本地就不需要写路径。但是如果不是本地,而是安装在XXX目录下,就要写
<div align="center"><img height="120" alt="" width="120" src="/xxx/{$goods.goods_thumb}" /></div>

希望大家象巴巴牛学习,天天向上!

这个问题还不懂的兄弟可以PM我!

回答:


补充下:
如果只是想“打印订单时显图片”,只需修改order.php 大约 2432行(2.70正式版),加上 ,g.goods_thumb

原来是:
  1. $sql = "SELECT o.*, g.goods_number AS storage, o.goods_attr, IFNULL(b.brand_name, '') AS brand_name " .
复制代码
改成:
  1. $sql = "SELECT o.* ,g.goods_thumb, g.goods_number AS storage, o.goods_attr, IFNULL(b.brand_name, '') AS brand_name " .
复制代码


并且在 大约 2463 行
  1. $goods_attr[] = explode(' ', trim($row['goods_attr'])); //将商品属性拆分为一个数组
复制代码
上面
加上以下3行(作用是调用出来的图片不必管路径,这3行是官方的,其它地方抄过来:))
  1. $_goods_thumb = get_image_path($row['goods_id'], $row['goods_thumb'], true);
  2. $_goods_thumb = (strpos($_goods_thumb, 'http://') === 0) ? $_goods_thumb : $ecs->url() . $_goods_thumb;
  3. $row['goods_thumb'] = $_goods_thumb;
复制代码

在order_print.html里调用方法:
  1. <img src="{$goods.goods_thumb}" />
复制代码


以上为批量打印订单时显示商品图,如果是订单详情页点“打印订单”需要修改另一处
order.php 310行左右(2.70)具体修改参照上面

,终于解决了。找了一天,都不行,原来没有顶起。

請問
我只要點進訂單看得到商品圖片
從印表機印出來時不要將圖片印出來
這樣要怎麼改?

顶 拜托帮我回答一下我的问题

我照上面的做了
但顯示以下:

Warning: Cannot modify header information - headers already sent by (output started at /home/fashionc/public_html/admin/order.php:1) in /home/fashionc/public_html/includes/cls_template.php on line 58

Warning: Cannot modify header information - headers already sent by (output started at /home/fashionc/public_html/admin/order.php:1) in /home/fashionc/public_html/admin/includes/init.php on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/fashionc/public_html/admin/order.php:1) in /home/fashionc/public_html/admin/includes/init.php on line 326

Warning: Cannot modify header information - headers already sent by (output started at /home/fashionc/public_html/admin/order.php:1) in /home/fashionc/public_html/admin/includes/init.php on line 327

Warning: Cannot modify header information - headers already sent by (output started at /home/fashionc/public_html/admin/order.php:1) in /home/fashionc/public_html/admin/includes/init.php on line 328

Warning: Cannot modify header information - headers already sent by (output started at /home/fashionc/public_html/admin/order.php:1) in /home/fashionc/public_html/admin/includes/init.php on line 329

Warning: Cannot modify header information - headers already sent by (output started at /home/fashionc/public_html/admin/order.php:1) in /home/fashionc/public_html/admin/includes/lib_main.php on line 706

Warning: Cannot modify header information - headers already sent by (output started at /home/fashionc/public_html/admin/order.php:1) in /home/fashionc/public_html/admin/includes/lib_main.php on line 707

Warning: Cannot modify header information - headers already sent by (output started at /home/fashionc/public_html/admin/order.php:1) in /home/fashionc/public_html/admin/includes/lib_main.php on line 708

求助~~~!!!

我只要點進訂單看得到商品圖片
從印表機印出來時不要將圖片印出來
這樣要怎麼改?

定,学习一下,

http://bbs.ecshop.com/thread-95341-1-1.html
27