Magento: Overriding customer account controller

前端 未结 1 512
傲寒
傲寒 2021-01-02 13:58

Hi I\'m trying to override Mage_Customer_AccountController, so that I can extend the createPostAction method. For the life of me I can\'t seem to do this, it either throws a

相关标签:
1条回答
  • 2021-01-02 14:45

    Instead, you can try as:

    ...   
     <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 more info about controller overriding:
    https://stackoverflow.com/a/7117076/887385

    Good Luck!!

    0 讨论(0)
提交回复
热议问题