Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

List Manufacturers and Categories in Sidebar - For Online Clothing Store
 
shopwoc
Member
 
Total Posts:  45
Joined:  2008-10-07
 

I am looking to list all the Categories and all the Manufacturers (Designers) in the sidebar.  You can see a sample of what I am trying to do on almost any clothing site.  Examples are http://www.bluefly.com or http://www.shopbop.com I do not need to know how to the extra javascript these sites might have, all I need is a way to list the all the Categories I’ve created and all the Designers/Manufacturers that have a product associated with them.  Is there any simple way to do this?  I’d like to keep the filtering underneath each of these lists.  This would be great!  Thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
shopwoc
Member
 
Total Posts:  45
Joined:  2008-10-07
 

I found this solution but still need to make them links to list all the products by the category.

I found how to list an attribute (in this case the manufacturer) It’s easy to change depending on the attribute. I haven’t been able to make them links to all the products for the particular designer so if anyone knows that please post it here.  Thanks.

Put this function in the Block:

public function getAllManu()     {       
$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);      
 return 
$manufacturers;                  
 
}

Put this in the template(you can make it a dropdown by just changing your html if you wish):

<ul id="manufacturer_list">    
    
<?php foreach ($this->getAllManu() as $manufacturer): ?>         
        
<li><?php echo $manufacturer['label'] ?></li>     
    
<?php endforeach; ?> 
</ul>
 
Magento Community Magento Community
Magento Community
Magento Community
 
nkdineshdct
Member
 
Avatar
Total Posts:  66
Joined:  2008-08-29
India
 

How i can filter the manufacturer for the corresponding items ordered.

I have created the custom module in the admin side and i want to display the distributor (manufacturer) list for the item ordered in the template file.

For eg,

p1,p2 --> Products.

D1,D2-->Distributors

If the customer order product p1 and p2, then it should display the manufacturer list for p1 and p2 ie) Name of D1, D2.

Template contains the List of distributor for the item ordered and list of items for the particular order.

Can u give me a suggestion.

Thanks
Dinesh

 
Magento Community Magento Community
Magento Community
Magento Community
 
sanjiovani
Jr. Member
 
Total Posts:  3
Joined:  2008-11-22
 

How did you create a designer list

http://www.bluefly.com/designers.fly

PS. great job with the site

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageClub
Guru
 
Avatar
Total Posts:  386
Joined:  2009-07-25
India
 

Hi..
I need the same thing, “List Manufacturers and Categories in Sidebar”

HOW DO WE DO THAT ???

 
Magento Community Magento Community
Magento Community
Magento Community
 
citiusrab
Jr. Member
 
Total Posts:  8
Joined:  2010-08-15
 

@shopwoc
Hi. To see all manufacturers of category.

protected function getCategoryManufacturers (Mage_Catalog_Model_Category $category)
    
{
        $layer 
Mage::getSingleton('catalog/layer');
        
$currentCutegory $layer->getCurrentCategory();
        
$layer->setCurrentCategory($category);
        
$products $layer->getProductCollection();
        foreach (
$products as $product{
            $manufacturers[$product
->getData('manufacturer')
                
$product->getAttributeText('manufacturer'); 
        
}
        $layer
->setCurrentCutegory($currentCutegory);
        return 
$manufacturers;
    
}
This solution is not very good, but it works.
 
Magento Community Magento Community
Magento Community
Magento Community
 
MattStephens
Sr. Member
 
Avatar
Total Posts:  152
Joined:  2011-07-12
United Kingdom
 

To only output Manufacturers of the current category or layer selection you can do the following:

$category Mage::registry('current_category');
        
$layer Mage::getSingleton('catalog/layer');
        
$layer->setCurrentCategory($category);
        
$attributes $layer->getFilterableAttributes();
        
$manufacturers = array();
        foreach (
$attributes as $attribute{
            
if ($attribute->getAttributeCode() == 'manufacturer'{
                $layerFilterBlockName 
'catalog/layer_filter_attribute';
                
$result Mage::app()->getLayout()->createBlock($layerFilterBlockName)->setLayer($layer)->setAttributeModel($attribute)->init();
                foreach(
$result->getItems() as $option{
                    $manufacturers[$option
->getValue()$option->getLabel();
                
}
            }
        }
        
return $manufacturers;

More information on how layers in Magento work can be found here

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amasty
Mentor
 
Avatar
Total Posts:  3988
Joined:  2009-11-10
 

All-in-one solution for the brands and attributes navigation is Improved Navigation extension. You can check user guide, screens and live demo at the module page.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jonake
Jr. Member
 
Total Posts:  3
Joined:  2013-10-30
 

When your website created? Carefully check, my previous website(dressfirst.com) is the problem, now resolved

 
Magento Community Magento Community
Magento Community
Magento Community
 
mahnoormalik
Jr. Member
 
Total Posts:  1
Joined:  2013-12-30
 

We have to create our website very carefully i have created a website recently(http://adclout.com)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Monty_iLM
Guru
 
Total Posts:  450
Joined:  2013-11-05
 

Hi,

For list manufacturers and categories in sidebar you have to put this in a block :

protected function getCategoryManufacturers (Mage_Catalog_Model_Category $category)
    
{
        $layer 
Mage::getSingleton('catalog/layer');
        
$currentCutegory $layer->getCurrentCategory();
        
$layer->setCurrentCategory($category);
        
$products $layer->getProductCollection();
        foreach (
$products as $product{
            $manufacturers[$product
->getData('manufacturer')
                
$product->getAttributeText('manufacturer'); 
        
}
        $layer
->setCurrentCutegory($currentCutegory);
        return 
$manufacturers;
    
}

Hope this will help you!!

Thanks

Monty
iLoveMage

 
Magento Community Magento Community
Magento Community
Magento Community
 
fitzhall27
Jr. Member
 
Total Posts:  5
Joined:  2013-12-23
 

Template contains the List of distributor for the item ordered and list of items for the particular order.

-------------------------
good-backlink.com

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top