protected function _createCollection($storeId) { $configOptions = $config = Mage::getConfig()->loadModulesConfiguration('system.xml')->getNode()->asArray(); $collection = new Varien_Data_Collection(); $requiredSections = array('weltpixel_selector', 'weltpixel_colorsettings', 'weltpixel_fontsettings', 'weltpixel_layerednavigation'); foreach ($configOptions['sections'] as $section => $sectionOptions) { if (in_array($section, $requiredSections)) { $sectionName = $sectionOptions['label']; foreach ($sectionOptions['groups'] as $group => $groupOptions) { $groupName = $groupOptions['label']; foreach ($groupOptions['fields'] as $field => $fieldOptions) { $fieldName = $fieldOptions['label']; $item = new Varien_Object(); $item->setTitle($sectionName . '/' . $groupName . '/' . $fieldName); $item->setPath(implode('/', array($section, $group, $field))); $item->setValue(Mage::getStoreConfig(implode('/', array($section, $group, $field)), $storeId)); $collection->addItem($item); unset($item); } } } } $this->setItems($collection); }
/** * Process category data after save category object * save related products ids and update path value * * @param Varien_Object $object * @return Mage_Catalog_Model_Resource_Category */ protected function _afterSave(Varien_Object $object) { /** * Add identifier for new category */ if (substr($object->getPath(), -1) == '/') { $object->setPath($object->getPath() . $object->getId()); $this->_savePath($object); } $this->_saveCategoryProducts($object); return parent::_afterSave($object); }