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

Own source model for an attribute and catalag layered navigation
 
sp00ner
Jr. Member
 
Total Posts:  1
Joined:  2012-01-26
 

hi guys,

i have an own source model for my attribute which i want to use it in the layered navigation to filter products.
The problem is i cant see it in frontend. I did tests with- and without source model, so if i set the values in backend the filtering is working great but with a source model i see nothing :(
I found a possible reason for this problem, but i am not sure - maybe the Magento Index management is responsible to get the data for catalog layer and in this case the indexer is not able to read it from my source model ?!  This is only my suggestion.

How can i solve this problem ?
My source model sample code:

class Company_Extension_Model_Entity_Attribute_Source_Regions extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
    {
        
public function getAllOptions()
        
{
            $regions 
Mage::getModel('company/regions')->getCollection();
            
$regions->getSelect()->order('region''ASC');
                        
            
$this->_options[] = array( 
                
'label' => Mage::helper('company')->__('Alle'),
                
'value' => 'all' 
            
);
            
            foreach( 
$regions as $region )
            
{
                $this
->_options[] = array( 
                    
'label' => $region->getRegion(), 
                    
'value' => $region->getId() 
                );
            
}                    
            
return $this->_options;
        
}
        
    }

Please help me guys, i searched for this but i coudnt find a solution for it :/
I would be very happy, if you can give me a working example of code…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Vishal Surani
Jr. Member
 
Avatar
Total Posts:  14
Joined:  2010-04-13
 

You can’t use flat table with source module.

Please disable flat catalog from backend and try

Let me know if you have more issue

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