官方有提供订单导出插件,但是导出的订单内容不带产品图片,如何在Zen cart后台订单显示产品图片?SEMSTUDIO分享zen cart后台订单显示产品图片。
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、完成。如果不会手动修改的话可以下载我修改过的文件,下载地址:http://i9.cm/down/houtaidingdanxianshitupian.rar
如看不到链接请点这里下载
zen cart默认的Bestsellers栏目只显示文字,它又显示图片又显示文字?在那里修改?介绍给大家一个方法:
修改tpl_best_sellers.php(/includes/templates/template_default/sideboxes)文件里的
for ($i=1; $i<=sizeof($bestsellers_list); $i++)
用下面的代码替换
$content .= ‘<li><a href=”‘ . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), ‘products_id=’ . $bestsellers_list[$i]['id']) . ‘”>’ . zen_get_products_image($bestsellers_list[$i]['id']) . zen_trunc_string($bestsellers_list[$i]['name'], BEST_SELLERS_TRUNCATE, BEST_SELLERS_TRUNCATE_MORE) . ‘</a></li>’ . “n”;
图片大小修改:网站后台-Configuration-images- small image width/small image height 改大小即可 !
也可以下载http://i9.cm/down/bestsellers.rar?如果看不到请点击这里