Magento Shop by Brands [closed]

让人想犯罪 __ 提交于 2020-02-05 03:30:25

问题


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).



来源:https://stackoverflow.com/questions/6292448/magento-shop-by-brands

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!