0

我正在尝试列出(带有链接)具有特定类别产品的所有制造商。这有效:

            $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>';
                    }
                }
            }

但是当我在制造商类别页面之一时,属性链接消失了。我假设是因为它使用了分层导航模型。

无论如何,是否可以在不使用分层导航模型的情况下获得特定类别的制造商列表?

4

1 回答 1

0

您好,我认为您创建了新的自定义模块并将 xml 标记从 catalog.xml 覆盖到您的布局 xml

/app/design/frontend/base/default/layout/catalog.xml

使用左/右/内容等参考名称调用制造块

于 2012-12-11T05:38:59.220 回答