Zencart暢銷產品(bestsellers)與後臺訂單顯示圖片

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?如果看不到請點擊這裏

 

本文轉自:http://i9.cm/studio/2011/04/40.html 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章