Studyon Minte9.com
Magento




Extend core controller



1) Create local module (ex. My/Customer)
	
	-- app/code/local/My/Customer/controllers/AccountController.php
	
	<?php
	require_once("Mage/Customer/controllers/AccountController.php");
	class My_Customer_AccountController extends Mage_Customer_AccountController { ... }

2) Load module before core module (Mage_Customer)

	-- app/code/local/Customer/etc/config.xml

	<?xml version="1.0" encoding="UTF-8"?>
	<config>
		<modules>
			<My_Customer>
				<version>0.1.0</version>
			</My_Customer>
		</modules>
		<frontend>
		<routers>
		<customer>
		<args>
		<modules>
			<My_Customer before="Mage_Customer">My_Customer</My_Customer>
		</modules>
		</args>
		</customer>
		</routers>
		</frontend>
	</config>


3) Activate module

	-- app/etc/modules/My_Customer.xml

	<?xml version="1.0"?>
	<config>
		<modules>
			<My_Customer>
				<active>true</active>
				<codePool>local</codePool>
				<depends>
					<Mage_Customer />
				</depends>
				<version>0.1.0</version>
			</My_Customer>
		</modules>
	</config>


http://www.dhmedia.com.au/blog/how-do-i-override-controller-actions-magento-14