/** * Get filter items count * * @return int */ public function getItemsCount() { $attributeIsFilterable = $this->getAttributeModel()->getIsFilterable(); if ($attributeIsFilterable == Mage_Catalog_Model_Layer_Filter_Attribute::OPTIONS_ONLY_WITH_RESULTS) { return parent::getItemsCount(); } $count = 0; foreach ($this->getItems() as $item) { if ($item->getCount()) { $count++; } } return $count; }