Magento 按品牌购物 [英] Magento Shop by Brands

查看:35
本文介绍了Magento 按品牌购物的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在导航中按品牌添加商店.这是我的代码

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

很显然,输出将我带到搜索结果页面,该页面显示为品牌 http:的搜索结果页面://img820.imageshack.us/img820/7303/searchd.jpg .但是我想要没有文本搜索结果的结果页.

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.

推荐答案

我个人更喜欢另一种方法,使品牌不是基于属性而是基于类别(例如,将两个根类别设为类别"和品牌".其中一个将类别归为子类别,类别和其他品牌).

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 按品牌购物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆