Thursday, January 2, 2014

Magento : How to add Indexes in a custom module

Follow these steps:

config.xml:

<index>                              
<indexer>
<cms_indexer>
<model>module/cmsindexer</model>
</cms_indexer>
</indexer>
</index>            

Model:

cmsindexer.php

Class Module_Model_CmsIndexer extends Mage_Index_Model_Indexer_Abstract
{

public function getName(){
                return 'Add CMS Cache';
}

public function getDescription(){
return 'Rebuild Cache Index for all CMS Pages';
}

protected function _processEvent(Mage_Index_Model_Event $event){
// process
}

public function reindexAll(){
//Your Function to be executed
}

No comments:

Post a Comment