File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,9 @@ public function getFilterableAttributes()
212212            foreach  ($ setAttributeIds  as  $ attributeId ) {
213213                if  (!isset ($ attributes [$ attributeId ])) {
214214                    $ attribute  = $ eavConfig ->getAttribute (Mage_Catalog_Model_Product::ENTITY , $ attributeId );
215+                     if  (!$ this  ->_filterFilterableAttributes ($ attribute )) {
216+                         continue ;
217+                     }
215218                    if  ($ attribute  instanceof  Mage_Catalog_Model_Resource_Eav_Attribute && $ attribute ->getIsFilterable ()) {
216219                        $ attributes [$ attributeId ] = $ attribute ;
217220                    }
@@ -249,6 +252,15 @@ protected function _prepareAttributeCollection($collection)
249252        return  $ collection ;
250253    }
251254
255+     /** 
256+      * Filter which attributes are included in getFilterableAttributes 
257+      * 
258+      */ 
259+     protected  function  _filterFilterableAttributes (Mage_Catalog_Model_Resource_Eav_Attribute   $ attribute ): bool 
260+     {
261+         return  $ attribute ->getIsFilterable () > 0 ;
262+     }
263+ 
252264    /** 
253265     * Retrieve layer state object 
254266     * 
Original file line number Diff line number Diff line change @@ -99,6 +99,15 @@ protected function _prepareAttributeCollection($collection)
9999        return  $ collection ;
100100    }
101101
102+     /** 
103+      * Filter which attributes are included in getFilterableAttributes 
104+      * 
105+      */ 
106+     protected  function  _filterFilterableAttributes (Mage_Catalog_Model_Resource_Eav_Attribute    $ attribute ): bool 
107+     {
108+         return  $ attribute ->getIsVisible () && $ attribute ->getIsFilterableInSearch () > 0 ;
109+     }
110+ 
102111    /** 
103112     * Prepare attribute for use in layered navigation 
104113     * 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments