我已经添加自定义属性到类别在magento现在我需要选择这些属性过滤器在自定义module.can谁能帮我吗?任何帮助都会非常感谢。
谢谢你,伊尔凡
发布于 2013-07-25 19:05:06
$categories = Mage::getModel('catalog/category')
->getCollection()
->addAttributeToFilter('attribute_code_here', 'value_here');
$categories->addAttributeToFilter('parent_id', 2);//if you want only children of a specific category
foreach ($categories as $category){
//do something with $category
}发布于 2013-07-26 20:34:40
不要紧,我得到了解决方案。我只需添加下面的代码行,它就可以工作了
->addAttributeToFilter('door_material',53)
其中"door_material"是类别的自定义属性,"53"是后端选择的选项id,希望能对某些人有所帮助。
https://stackoverflow.com/questions/17856160
复制相似问题