这个问题调试了好久了,历时也快半年了,之前网上资料一直有限,今天终于找到了解析办法了。
首页要谢谢zen-cart.cn社区,这个社区的版主都非常热心,如果你也正在用zen cart那么,不仿到这里学习学习。
进入正题,Zencart 之lightinthebox模板,产品排序修改 这篇文章也介绍了如何让分类产品排名显示最新,根据他的步骤搞了,但不成功,后来在zen cart社区看到了这文章:www.zen-cart.cn/forum/topic16254.html 综合两帖子,问题解决:
1: \includes\index_filters\default_filter.php
将case 5的:order by p.products_date_added DESC改成:order by p.products_ordered DESC
将default的:order by p.products_ordered DESC改成:order by p.products_date_added DESC
2:\includes\modules\product_listing.php
Bestselling 跟New Arrival 互换位置
3:\includes\index_filters\default_filter.php
这里比较重要了,决定了是否成功:
// We show them all
$listing_sql = “select ” . $select_column_list . ” p.products_id, p.products_type,p.products_status,p.products_price,p.products_price_retail,p.products_price_sample,p.product_is_wholesale,p.product_wholesale_min,p.products_quantity, p.products_quantity_order_min, p.master_categories_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status =1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status
from ” . TABLE_PRODUCTS_DESCRIPTION . ” pd, ” .
TABLE_PRODUCTS . ” p left join ” . TABLE_MANUFACTURERS . ” m on p.manufacturers_id = m.manufacturers_id, ” .
TABLE_PRODUCTS_TO_CATEGORIES . ” p2c left join ” . TABLE_SPECIALS . ” s on p2c.products_id = s.products_id
where p.products_status = 1
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
and pd.language_id = ‘” . (int)$_SESSION['languages_id'].”‘”. $displayOrder. $priceOrder.”
and ” . $product_in_categories_sql;
在这段代码的最后一句的;前加入:. ” order by p.products_date_added DESC” 也就是最后一句改成:
and ” . $product_in_categories_sql. ” order by p.products_date_added DESC”; (责任编辑:好模板) |