zencart产品排序的问题: 个人认为:后台是有这个选项的,但是很多客户都不喜欢这个,希望把最新的产品排到前面去! 参考别人的更改代码:用批量的sortorder 很明显是很不明智的做法,最好的方法是改核心的代码判断设置! 如果zencart产品排序 下面的办法不能解决的话,那么只要设置更改如下的简单方法: 根据后台设置她的排序为按model排序,那么就好办多了! 附完整步聚: 1.默认default:的 sql改为order by p.products_date_added DESC ,原来case5改为$product_sort = ” order by p.products_ordered DESC”; {文件地址:\includes\index_filters\default_filter.php} 2.修改product_listing.php的
array(‘Bestselling’,'Item Name’,'Price(Low to high)’,'Price(High to low)’,'New Arrival’); 为 $nsort = array(‘New Arrival’,'Item Name’,'Price(Low to high)’,'Price(High to low)’,'Bestselling’); {文件地址:\includes\modules\product_listing.php} 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; } } ————————————–> // We show them all if ($_GET['productsort'] ==”) { $sort = ‘ order by p.products_date_added DESC’; }else{ $sort = ”; } $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 . $sort; } }可以参考上面的方法去解决,如果还是没能解决问题的话,....找我吧!