public function getCacheKey() { $key = parent::getCacheKey(); $customerGroupId = $this->_getCustomerGroupId(); $productId = Mage::registry('current_product') ? Mage::registry('current_product') : 0; $cmsPageId = Mage::app()->getRequest()->getParam('page_id', Mage::getStoreConfig(Mage_Cms_Helper_Page::XML_PATH_HOME_PAGE)); return 'MAGICAT_' . $key . '_' . $customerGroupId . '_' . $productId . '_' . $cmsPageId; }
/** * Set this so the navigation is cached depending on the login state. * Otherwise, the cache navigation could be shown to a logged in customer, or vica versa. * * Use the customer group instead of the login state so this extension compatible * with the Netzarbeiter_GroupsCatalog extension, in case both extensions are * installled at the same time. */ public function getCacheKey() { $session = Mage::getSingleton('customer/session'); if (!$session->isLoggedIn()) { $customerGroupId = Mage_Customer_Model_Group::NOT_LOGGED_IN_ID; } else { $customerGroupId = $session->getCustomerGroupId(); } return parent::getCacheKey() . $customerGroupId; }