我正在尝试列出(带有链接)具有特定类别产品的所有制造商。这有效:
$category = 56;
$layer = Mage::getModel("catalog/layer");
$layer->setCurrentCategory($category);
$attributes = $layer->getFilterableAttributes();
$manufacturers = array();
foreach ($attributes as $attribute) {
if ($attribute->getAttributeCode() == 'manufacturer') {
$filterBlockName = 'catalog/layer_filter_attribute';
$result = Mage::app()->getLayout()->createBlock($filterBlockName)->setLayer($layer)->setAttributeModel($attribute)->init();
foreach($result->getItems() as $option) {
echo '<li><a href="'.$this->getUrl('').'bats.html?manufacturer=' .$option->getValue().'">'.$option->getLabel().'</a></li>';
}
}
}
但是当我在制造商类别页面之一时,属性链接消失了。我假设是因为它使用了分层导航模型。
无论如何,是否可以在不使用分层导航模型的情况下获得特定类别的制造商列表?