Protected Member Functions | |
_afterSave () |
Definition at line 34 of file Category.php.
_afterSave | ( | ) | [protected] |
Processing object after save data
Reimplemented from Mage_Core_Model_Abstract.
Definition at line 36 of file Category.php.
00037 { 00038 if ($this->getScope() == 'stores') { 00039 $rootId = $this->getValue(); 00040 $storeId = $this->getScopeId(); 00041 00042 $category = Mage::getSingleton('catalog/category'); 00043 $tree = $category->getTreeModel(); 00044 00045 // Create copy of categories attributes for choosed store 00046 $tree->load(); 00047 $root = $tree->getNodeById($rootId); 00048 00049 // Save root 00050 $category->setStoreId(0) 00051 ->load($root->getId()); 00052 $category->setStoreId($storeId) 00053 ->save(); 00054 00055 foreach ($root->getAllChildNodes() as $node) { 00056 $category->setStoreId(0) 00057 ->load($node->getId()); 00058 $category->setStoreId($storeId) 00059 ->save(); 00060 } 00061 } 00062 return $this; 00063 }