/** * Apply event to category * * @param Varien_Data_Tree_Node|Mage_Catalog_Model_Category $category * @param Varien_Data_Collection $eventCollection * @return Enterprise_CatalogEvent_Model_Observer */ protected function _applyEventToCategory($category, Varien_Data_Collection $eventCollection) { foreach (array_reverse($this->_parseCategoryPath($category->getPath())) as $categoryId) { // Walk through category path, search event for category $event = $eventCollection->getItemByColumnValue('category_id', $categoryId); if ($event) { $category->setEvent($event); return $this; } } return $this; }