Magento: Overriding customer account controller

前端 未结 1 523
傲寒
傲寒 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:

    ...   
     
            
                
                    
                        
                            Company_Modulename
                        
                    
                
            
        
    ...
    

    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)
提交回复
热议问题