Magento品牌商店

时间:2011-06-09 12:01:22

标签: magento

我正在尝试按行业中的品牌添加商店。这是我的代码

<?php
$product=Mage::getModel('catalog/product');
$attributeInfo=Mage::getResourceModel('eav/entity_attribute_collection')->addFieldToFilter('attribute_code','shoe_type')->load(false);
$attribute=$attributeInfo->getFirstItem()->setEntity($product->getResource());
$shoes=$attribute->getSource()->getAllOptions(false);
$url='catalogsearch/result/?q=';
foreach($shoes as $shoe):
    $val=$shoe['label'];
?>
    <a href="<?php echo Mage::getURL().$url.$val?>"><?php echo $shoe['label']?></a>
<?php endforeach;?>

显然,输出会将我带到搜索结果页面,该页面显示为品牌http://img820.imageshack.us/img820/7303/searchd.jpg的搜索结果。但我希望结果页面没有文字search results for

他们是否有其他方式在航海中按品牌展示商店?任何帮助都将受到赞赏。

1 个答案:

答案 0 :(得分:7)

就个人而言,我更喜欢另一种方法,使品牌不属于属性而是类别(例如,制作两个根类别“类别”和“品牌”。一个将类别作为子类别和另一个品牌)。