【发布时间】:2011-08-15 18:09:30
【问题描述】:
所以我有一个名为“背包”的类别,我想获得所有背包制造商。我如何在 Magento 中做到这一点。这可能吗?以下代码将获取所有制造商,但如何进一步过滤它。我正在使用 Magento 社区 1.3。
$product = Mage::getModel('catalog/product');
$attributes = Mage::getResourceModel('eav/entity_attribute_collection')
->setEntityTypeFilter($product->getResource()->getTypeId())
->addFieldToFilter('attribute_code', 'manufacturer');
$attribute = $attributes->getFirstItem()->setEntity($product->getResource());
$manufacturers = $attribute->getSource()->getAllOptions(false);
print_r($manufacturers);
任何建议都会有很大帮助。我在谷歌上有搜索和搜索。但我似乎找不到按类别过滤属性的方法。因为我相信这就是我想要做的。
【问题讨论】:
标签: php magento attributes filter categories