Magento Layered Navigation Filters using Simple Configurable -


i have configurable product simple products associated it. ex. shoe attributes size , width on simple.

  1. when filter width , size, shows configurable though simple product size , width don't exist.

i've seen asked before here in numerous forms no solutions. know how fix functionality? i'm amazed how not built out of box.

https://magento.stackexchange.com/questions/18001/shop-by-layered-navigation-configurable-products-not-filtering-correctly

magento - layered navigation, configurable products, multiple filters active issue

you have customize core file copying in local/mage directory.

suppose have variations size & color.

open file app\code\core\mage\catalog\model\layer.php

after following code:-

$collection   ->addattributetoselect(     mage::getsingleton('catalog/config')->getproductattributes()   )   ->addminimalprice()   ->addfinalprice()   ->addtaxpercents()   ->addurlrewrite($this->getcurrentcategory()->getid()); 

you have customize selected attribute:-

for example :-

if(isset($_get['size']))     {         $query = 'select value aw_layerednavigation_filter_option_eav name="title" , option_id in ( '.$_get['size'].' )';         $results = $readconnection->fetchall($query);         $sizelabels = array();         foreach($results $_r){             $size_labels[] = $_r['value'];         }          $query = 'select parent_id advance_filter size in ( '.implode(",",$size_labels).' ) , qty > 0';          $results = $readconnection->fetchall($query);         foreach($results $_r){             $size_prod_ids[] = $_r['parent_id'];         }        }     $color_prod_ids = array();     if(isset($_get['color']))     {         $query = 'select value aw_layerednavigation_filter_option_eav name="title" , option_id in ( '.$_get['color'].' )';         $results = $readconnection->fetchall($query);         $color_labels = array();         foreach($results $_r){             $color_labels[] = strtoupper($_r['value']);         }          $query = 'select parent_id advance_filter color in ( "'.implode(",",$color_labels).'" ) , qty > 0';          $results = $readconnection->fetchall($query);         foreach($results $_r){             $color_prod_ids[] = $_r['parent_id'];         }     }     $productids = array_merge($size_prod_ids,$color_prod_ids);     if(count($productids) > 0){         $collection->addattributetofilter('entity_id', array('in' => array_unique($productids)));     } 

hope help..!!


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -