# 让Zen Cart后台订单中显示产品图片

**URL:** <https://www.isharkfly.com/t/zen-cart/5514>\
**Category:** PHP\
**Created:** [August 6, 2012, 1:50am UTC](https://www.isharkfly.com/t/zen-cart/5514 "2012-08-06T01:50:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [August 6, 2012, 1:50am UTC](https://www.isharkfly.com/t/zen-cart/5514/1 "2012-08-06T01:50:19Z")

</div>

1、打开admin目录里的orders.php文件，查找：`for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { 
echo ‘ <tr>’ . “n” . 
‘ <td valign=”top” align=”right”>’ `在后面添加：`‘<img src=../images/’ . $order->products[$i]['image'] . ‘ align=top>’ `2、打开admin/includes/classes目录里的order.php文件，查找：`$orders_products = $db->Execute(“select orders_products_id, products_name, products_model, 
products_price, products_tax, products_quantity, 
final_price, onetime_charges, 
product_is_free 
from ” . TABLE_ORDERS_PRODUCTS . ” 
where orders_id = ‘” . (int)$order_id . “‘”); `替换为：`$orders_products = $db->Execute(“select o.orders_products_id, o.products_id, o.products_name, o.products_model, 
o.products_price, o.products_tax, o.products_quantity, 
o.final_price, o.onetime_charges, 
o.product_is_free, p.products_id, p.products_image 
from ” . TABLE_ORDERS_PRODUCTS . ” o, ” . TABLE_PRODUCTS . ” p 
where o.orders_id = ‘” . (int)$order_id . “‘ and o.products_id = p.products_id”); `查找：`name’ => $orders_products->fields['products_name'], `在后面添加：`‘image’ => $orders_products->fields['products_image'], `3、完成。
