Thursday, 14 April 2016

how get Selected filter In layered navigation magento


All the applied filters are stored in layer state object. You can easily retrieve them by using the following snippet:

$appliedFilters = Mage::getSingleton('catalog/layer')->getState()->getFilters();

 foreach ($appliedFilters as $item) {
    $item->getName(); // Name of the filter
    $item->getLabel(); // Currently selected value
    $item->getFilter()->getRequestVar();
    }

No comments:

Post a Comment