I want to change my category display mode if there is active filters. My config.xml is :


And my observer is method is :

public function setCategoryDisplayMode(Varien_Event_Observer $observer)
    $category = Mage::registry('current_category');
    $appliedFilters = Mage::getSingleton('catalog/layer')
    if (!empty($appliedFilters)) {

But I am unable to get active filters with $appliedFilters = Mage::getSingleton('catalog/layer')->getState()->getFilters(); Is I am doing something wrong or my event is wrong?

I also tried with Mage::getSingleton('Mage_Catalog_Block_Layer_State')->getActiveFilters(); but no success.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.