我正在使用 magento 1.7.0.2。我使用此代码按制造商显示产品。但这表明产品按搜索条件。
我需要像这个页面一样在单个页面中显示产品产品(左下角的品牌)
<?php
$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);
?>
<h1>Brands</h1>
<ul id="manufacturer_list">
<?php foreach ($manufacturers as $manufacturer): ?>
<li><a href="<?php echo Mage::getBaseUrl(); ?>catalogsearch/advanced/result/?manufacturer[]=<?php echo $manufacturer['value'] ?>"><?php echo $manufacturer['label'] ?></a></li>
<?php endforeach; ?>
</ul>
谁来帮帮我。提前谢谢....... :)