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?
Asked
Active
Viewed 1,204 times
1

Stack user
- 519
- 6
- 19
-
You can not override magento controller like this way.you have to create a module then override a the controller. – Mukesh Sep 30 '15 at 12:58
-
can you please explain how can I do it with minimum code? – Stack user Sep 30 '15 at 12:59
-
1Try http://stackoverflow.com/a/12793093/1616003 and http://stackoverflow.com/a/30477461/1616003 Search Google for tutorials – Mukesh Sep 30 '15 at 13:01
-
Did you try solution provided by me? – Mukesh Oct 01 '15 at 08:47
1 Answers
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()
{
}
}
-
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
-
-
@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
-
1after changing the lines
Muk_Account_Customer Muk_Account