我在这里: 深圳seo » 〖ZEN-CART〗 » 浏览文章: 深圳seo:zencart商品排序问题详细操作!
« 深圳seo公司--客户的关键词设置zencart网站首页如何关闭Shopping by Categories »

深圳seo:zencart商品排序问题详细操作!

paypal跳转

深圳seo关于zencart商品排序问题解决方法如下:

完整步聚:

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;
}
}

 

另外一种方法:

由于新进商品的数量可能比页面上能显示的数量多,所以采用的是随机显示的方式。
如果想改为按时间顺序显示,可以按照radnows提供的方法修改。(记住使用文件替代)

zen cart新进商品的随机排序修改方法第一步:首先,新进商品可以自己定义时间段: 商店设置-最大值-新进商品的定义

zen cart新进商品的随机排序修改方法第二步:
修改首页上新进商品:
/includes/modules/new_products.php

在$new_products_query里增加相应ORDER BY xxx

例:select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, p.products_date_added, p.products_price, p.products_type, p.master_categories_id from zen_products p, zen_products_description pd where p.products_id = pd.products_id and pd.language_id = ‘1′ and p.products_status = 1 order by pd.products_name

zen cart新进商品的随机排序修改方法第三步:
修改边框中新进商品:
/includes/modules/sideboxes/whats_new.php

$random_whats_new_sidebox_product = zen_random_select($random_whats_new_sidebox_product_query);
改为
$random_whats_new_sidebox_product = $db->Execute($random_whats_new_sidebox_product_query);

zen cart新进商品的随机排序修改方法第四步:

然后将/includes/modules /new_products.php 文件中的:
$db->ExecuteRandomMulti
改为
$db->Execute

MoveNextRandom()
改为
MoveNext()

发表评论

为了防止SPAM,含链接的评论需要审核后才能显示。

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

www.51ctoall.cn