Magento Shop by Brands [closed]

2019-08-05 10:17发布

问题:

I am trying to add shop by brands in navigation.Here is my code

<?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;?>

Obviously,output takes me to search results page which displays as Search Results for brand http://img820.imageshack.us/img820/7303/searchd.jpg. But i want result page without the text search results for.

Is their any other way to display shop by brands in navigation?Any help will be appreciated.

回答1:

Personally I prefer another approach making brands not on attributes but categories (e.g. make two root categories "Categories" and "Brands". one will hold categories as sub-categories and another brands).



标签: magento