Esempio n. 1
0
 public function getItemsAsArray()
 {
     $items = array();
     foreach (parent::getItems() as $itemObject) {
         $item = array();
         $item['url'] = $this->htmlEscape($itemObject->getUrl());
         $item['label'] = $itemObject->getLabel();
         $item['count'] = '';
         $item['countValue'] = $itemObject->getCount();
         /** @todo Fix item counts */
         if (!$this->getHideCounts()) {
             $item['count'] = ' (' . $itemObject->getCount() . ')';
         }
         $item['css'] = 'amshopby-attr';
         if (in_array($this->getDisplayType(), array(1, 3))) {
             //dropdown and images
             $item['css'] = '';
         }
         if ($itemObject->getOptionId() == $this->getRequestValue()) {
             $item['css'] .= '-selected';
             if (3 == $this->getDisplayType()) {
                 //dropdown
                 $item['css'] = 'selected';
             }
         }
         $item['rel'] = $this->getSeoRel() ? ' rel="nofollow" ' : '';
         if ($item['countValue']) {
             $items[] = $item;
         }
     }
     return $items;
 }
Esempio n. 2
0
 public function getItems()
 {
     if (Mage::helper('gomage_navigation')->isGomageNavigation() && Mage::getStoreConfigFlag('gomage_navigation/stock/active')) {
         if (!$this->ajaxEnabled()) {
             $items = parent::getItems();
             foreach ($items as $key => $item) {
                 if ($category = Mage::getModel('catalog/category')->load($item->getValue())) {
                     $items[$key]->setUrl($category->getUrl());
                 }
             }
             return $items;
         }
     }
     return parent::getItems();
 }