列出Magento类别产品的制造商?

时间:2012-12-11 04:54:04

标签: php sql magento attributes categories

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

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

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

有没有使用分层导航模型获取特定类别的制造商列表?

1 个答案:

答案 0 :(得分:0)

您好我认为您创建了新的自定义模块&amp;将catalog.xml中的xml标记覆盖到布局xml

  

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

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