December 16, 2011 If you want to show the manufacturers list on your sidebar or anywhere else in magento site. You just need add some little code. First open the file app/code/core/Mage/Catalog/Block/Navigation.php Add the below code at the end of file public function getAllManu()
$product = Mage::getModel('catalog/product');
$attributes = Mage::getResourceModel('eav/entity_attribute_collection')
->addFieldToFilter('attribute_code', 'manufacturer'); //can be changed to any attribute
$attribute = $attributes->getFirstItem()->setEntity($product->getResource());
$manufacturers = $attribute->getSource()->getAllOptions(false); return $manufacturers;
} Now put below code in your theme file where you want to show the list. Foe example if you want to show the manufacturer list on top navigation. Then open app/design/frontend/defaultyour-theme-name/template/catalog/navigation/top.phtml Add the below code where you want to show the list: <ul>
<?php foreach ($this->getAllManu() as $manufacturer): ?>
<li><a href="<?php echo $this->getUrl() ?>/catalogsearch/advanced/result/?manufacturer=<?php echo $manufacturer['value'] ?>"><?php echo $manufacturer['label'] ?></li>
<?php endforeach; ?>
</ul> You can use the above process to call / show other attributes. But i would like to suggest you one thing "don't make any change on magento core file". You can make a custom module for it. Really simple way to do this make a Root Category" and "Sub category" and call subcategory for it. If you want how it can be done, please refer "How to get sub category list for specific category in magento".
As an ecommerce website developer or magento website developer, sometime we get the a situation when we forget the magento website admin access detail. To reset the password of any...
How to show all attribute after layered navigation filter in Magento
April 10, 2015
Magento Layered Navigation is really good for filter the product but problem is that, if we select any attribute like color or price all other attribute hide which are not...
How to fix layered navigation filer URL in Magento?
April 2, 2015
Magento is really good eCommerce CMS in terms of functionality. Layered Navigation is really good feature of Magento to filter the product in frontend side. Only problem with the layered navigation filter...