I am trying to override a Mage controller which is in Mage/Catalog/controllers/CategoryController.php
.
The folder structure which I created in trying to override the above controller is as follows:
--> app
--> code
--> core
--> local
--> Edge
--> AjaxCatalog
--> controllers
--> CategoryController.php
--> etc
--> config.xml
--> etc
--> modules
--> EdgeAjaxCatalog.xml
Edge/AjaxCatalog/controllers/CategoryController.php:
<?php
require_once Mage::getModuleDir('controllers', 'Mage_Catalog').DS.'CategoryController.php';
class Edge_AjaxCatalog_CategoryController extends Mage_Catalog_CategoryController
{
public function viewAction()
{
echo "alert('hi')"; //even tried Mage::log("controller..");
}
}
Edge/AjaxCatalog/etc/config.xml
<config>
<frontend>
<routers>
<catalog>
<args>
<modules>
<edge_ajaxcatalog before="Mage_Catalog_CategoryController">Edge_AjaxCatalog</edge_ajaxcatalog>
</modules>
</args>
</catalog>
</routers>
</frontend>
</config>
Edge_AjaxCatalog.xml
<?xml version="1.0"?>
<!--we need to enable this module as any other if-->
<!--you wish to do it as standalone module extension-->
<config>
<modules>
<edge_ajaxcatalog>
<active>true</active>
<codePool>local</codePool>
</edge_ajaxcatalog>
</modules>
</config>
Still I can't see the log message in system.log file. (log is enabled)
what should I do more to override this controller?
Please help
public function indexAction(){...}
or any other action you wanna override