我需要排列productCollection
产品清单Category
。Magento产品排序产品分类
我需要这个工具,因为在我的地盘我一定要显示新产品和在单独的页面(标签)特殊产品。
我甚至可以用addAttributetoSort()
为sku
,news_to_date
,news_from_date
,name
,price
等,但不能使用category_id
。它没有效果。
我知道我可以从管理面板中设置它在管理属性。在管理属性price
,name
可用于排序。即使我可以从管理属性创建sku
,news_to_date
等属性。但是,当我创建属性代码category
或category_id
,它带有像
System reserved category/category_id
指的错误,我不能使用category
或category_id
作为属性从管理属性(因为它们是由系统预留)。
任何人都可以建议如何做到这一点?
您应该编辑您的anwser因为没有名为'属性category_idS' 。正确的名称是'category_id' – RPDeshaies
- > addAttributeToSort('category_id','ASC')不适用于我 – Bogz