best seller 带有图片的设置
打开includes\modules\sideboxes\your_template\best_sellers.php,查找
select distinct p.products_id, pd.products_name, p.products_ordered
将其替换为:
select distinct p.products_id, p.products_image, p.products_price, pd.products_name, p.products_ordered
(注意:我这里使用的版本是zencart 1.38,在此版本下,最好将此文件的第34,51两行都替换,另外如果your_template下没有相应文件,则从template_default下复制);
步骤2:
查找:
$bestsellers_list[$rows]['name'] = $best_sellers->fields['products_name'];
在其它下面加入:
$bestsellers_list[$rows]['image'] = $best_sellers->fields['products_image'];
$bestsellers_list[$rows]['price'] = $best_sellers->fields['products_price'];
步骤3:
打开includes\templates\your_template\sideboxes\ tpl_best_sellers.php
(如果你使用的模板没有这个文件,请从默认模板下复制这个文件)
查找:
for ($i=1; $i<=sizeof($bestsellers_list); $i++) {
在其它下面加入:
$content .=’<a href=”‘ . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), ‘products_id=’ . $bestsellers_list[$i]['id']) . ‘”>’
.zen_image(DIR_WS_IMAGES . $bestsellers_list[$i]['image'], $best_sellers->fields['products_name'], SMALL_IMAGE_WIDTH*0.7, SMALL_IMAGE_HEIGHT*0.7)
.’</a>’ . $currencies->format(zen_trunc_string($bestsellers_list[$i]['price'], BEST_SELLERS_TRUNCATE, BEST_SELLERS_TRUNCATE_MORE), true, $orders->info['currency'], $orders->info['currency_value']);
哈,刚好在找这个
忽忽,你的页面还有错误的代码哦
看文章 。en。。o(∩_∩)o 哈哈
请高手赐教哦。。