【发布时间】:2011-04-06 14:51:04
【问题描述】:
我已使用以下代码获取制造商的完整列表。
$currentCategory = Mage::registry('current_category');
$product = Mage::getModel('catalog/product');
$attributes = Mage::getResourceModel('eav/entity_attribute_collection')->setEntityTypeFilter($product->getResource()->getTypeId())->addFieldToFilter('attribute_code', 'brand_name');
$attribute = $attributes->getFirstItem()->setEntity($product->getResource());
$manufacturers = $attribute->getSource()->getAllOptions(false);
现在,如何获取属于特定类别的制造商列表?我一直在挖掘一段时间以找到一种方法来按类别限制结果,但没有运气。 ResourceModel 可以按类别过滤吗?
谢谢。
【问题讨论】:
标签: magento attributes categories