Thursday, January 5, 2012

Magento How to get the Brand list in Product page

Add the Brand name on Product page

Note "manufacturer" is the Attribute code for Brand
<?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="#"><?php echo $manufacturer['label'] ?></a></li>
<?php endforeach; ?>
</ul>


No comments:

Post a Comment

Thankyou for your Comments

LinkWithin

Blog has moved, searching new blog...