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

 

 

你可能感兴趣的:(agent)