Magento: Overriding Client Account Controller

Hi, I am trying to override Mage_Customer_AccountController so that I can extend the createPostAction method. For life of me, I cannot do this, it either throws a 404 page, which suggests that this is not the correct path for the file or the default for orignal.

<rewrite> <company_modulename_account> <from><![CDATA[#^/customer/account/#]]></from> <to>/modulename/account</to> </company_modulename_account> </rewrite> 

My controller is here local / company / modulename / controller / AccountController.php

+8
magento
source share
1 answer

Instead, you can try:

 ... <frontend> <routers> <customer> <args> <modules> <company_modulename before="Mage_Customer">Company_Modulename</company_modulename> </modules> </args> </customer> </routers> </frontend> ... 

And create a controller class:
app / code / [codePool] /Company/Modulename/controllers/AccountController.php
with the following code:

 require_once 'Mage/Customer/controllers/AccountController.php'; class Company_Modulename_AccountController extends Mage_Customer_AccountController { public function createPostAction(){ die('Overriden'); } } 

Here is additional information about the controller:
stack overflow

Good luck !!

+24
source share

All Articles