magento如何改变产品的排序方式

magento中可以方便的设置前台产品的排序方式,我们可以设置sotr by为price,name,best value及其他一些attribute,以满足排序要求。magento默认的是Best Value,那到底什么是Best Value呢?

在官方手册上有么两段解释 version 1.7:
page 75./85. “Product Listing Sort By: The products are sorted, by default, by the selected attribute. The Best Value products are featured products as determined by the store administrator; for more information, see “Creating Categories,” page 83. The customer can select from the other options on a per-page basis. You can configure attributes to be used for sorting using the Used for Sorting in Product Listing setting of an attribute. For details, see “Managing Product Attributes,” page 92.”

page 88./98. “3. In the Position column, specify a whole number that indicates the order in which the product is listed when the products are sorted by Best Value. The product with a Position value of 1 is listed first, 2 is listed second, and so on. If more than one product has the same value for Position, the product with the lowest (that is, closest to 1) ID number is listed first.”

以管理员进入后台 (Catalog/Manage Categories),选择“Category Products” 这个tab,我们能看到这个分类下的所有产品,你会发现最后一个字段position,其实Best Value就是它决定的,position的值是一个整数,值是1的产品比值是2的产品优先显示,以此类推;如果多个产品的position相同,按产品ID由小到大优先显示,即product id接近1的产品先显示。


改变position的值,保存;在前台此分类页就会发现产品已经按照你设置的position值显示了(如果默认排序方式为position)。

有关排序的两种配置
1为每个category设置排序
以管理员进入后台 (Catalog/Manage Categories),点击Display Settings这个tab,在这里可以设置“Available Product Listing Sort By” 和“Default Product Listing Sort By”的值 。
先修改“Default Product Listing Sort By”,取消“Use Config Settings”,假设选择“Default Product Listing Sort By”为“Price”,在前台将会看到产品按照price升序排列;另外我们可以取消 “Use All Available Attributes” ,假设“Available Product Listing Sort By” 只选择“Best Value” 和“Price”,在前台会发现sort by只有“Best Value” 和“Price”可供选择排序了;保存后如图所示:



2为Store / Website / Default Config设置排序
管理员进入后台System / Configuration / Catalog (left menu) / Frontend ,会看到下拉框Product Listing Sort by,这个地方的排序选择,将会应用到Store或 Website或Default下的所有产品,至于应用到哪一个在左上角Current Configuration Scope处决定。但是要注意的是,这个配置的优先级是低于前面category的。



Magento 排序时查找配置的步骤
1:先找Category配置,没有则找2
2:找Store配置,没有则找3
3:找Website配置,没有则找4
4:找Default Config

最后我们可以在table core_config_data,或者 config.xml file ( app/code/core/Mage/Catalog/etc/config.xml  723行. – position)找到magento默认的排序是Position (“Best Value”);

本文链接地址 jonas的magento博客


  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值