首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

magento 高级搜寻 brand实例 Magento ‘Shop By Brand’ in SideBar

2012-12-27 
magento 高级搜索 brand实例 Magento ‘Shop By Brand’ in SideBar高级搜索地址一般为: /catalogsearch/adv

magento 高级搜索 brand实例 Magento ‘Shop By Brand’ in SideBar

高级搜索地址一般为: /catalogsearch/advanced/

?

First create the template file and name it productbrand.phtml place it in catalog/product folder

copy the code given below and paster it in you productbrand.phtml

?

Note: Please chnage ‘yourdomain.com’ with your site domain name

<h4><span>Product Brands</span></h4><div style="padding-left:8px;"><?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);?><ul id="manufacturer_list"><?php foreach ($manufacturers as $manufacturer): ?><li><a href="http://www.yourdomain.com/catalogsearch/advanced/result/?manufacturer[]=<?php echo $manufacturer['value'] ?>"><?php echo $manufacturer['label'] ?></a></li><?php endforeach; ?>   </ul></div>
?

from: http://www.magentoworks.net/magento-shop-by-brand-in-sidebar

?

?

热点排行