1

I have copied the "app/code/core/Mage/Customer/controllers/AccountController.php" to "app/code/local/Mage/Customer/controllers/AccountController.php" but it is not overriding the targeted file. what is getting wrong?

Stack user
  • 519
  • 6
  • 19

1 Answers1

3

Create following files:

1) app/etc/modules/Muk_Account.xml

<?xml version="1.0"?> 
<config> 
    <modules>
        <Muk_Account>
             <active>true</active>
             <codePool>local</codePool>
        </Muk_Account>        
    </modules>
</config>

2) app\code\local\Muk\Account\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>   
        <Muk_Account>
           <version>0.1.0</version>
        </Muk_Account>
    </modules>
    <frontend>
        <routers>
            <customer>
                <use>standard</use>
                <args>
                    <modules>
                        <Muk_Account before="Mage_Customer">Muk_Account_Customer</Muk_Account>
                    </modules>
                </args>
            </customer>
        </routers>
    </frontend>
</config>

3) app\code\local\Muk\Account\controllers\Customer\AccountController.php

<?php
require_once 'Mage/Customer/controllers/AccountController.php';
class Muk_Account_Customer_AccountController extends Mage_Customer_AccountController
{
    public function createPostAction()
    {
    }

}
E_net4
  • 27,810
  • 13
  • 101
  • 139
Mukesh
  • 7,630
  • 21
  • 105
  • 159
  • Thank you for help but dont know there is something getting wrong. are you sure there should be customer folder in controllers? I did as you said but sorry still no luck. – Stack user Sep 30 '15 at 13:25
  • and there is no error showing but core file is executing still. – Stack user Sep 30 '15 at 13:26
  • @Ren What do you want to override? You have to modify the code in the app\code\local\Muk\Account\controllers\Customer\AccountController.php file.Currently it is blank. – Mukesh Sep 30 '15 at 13:32
  • 1
    after changing the lines Muk_Account_Customer to Muk_Account and class name to Muk_Account_AccountController its working perfectly. – Stack user Nov 02 '15 at 04:36