Hi, today I’ll show you how to edit Magento’s core module without messing with core files themselves, or “the right way of doing things”.
First of all, I chose Magento’s Customer module and its Account controller as an example. First, you need to find it in Magento’s Core folder (full path: “app/code/core/Mage/Customer/controllers/AccountController.php“).
First step is to create and place folders in your module that will override Magento’s core controller. On to that part:
- First, create this file in same folder structure:app/code/local/Inchoo/Coreextended/controllers/Frontend/Customer/AccountController.php. (of course, you can always replace Inchoo with desired namespace, and Coreextended with some other module name, but you’ll need to edit the rest accordingly).
- Then create xml for our module located here:app/code/local/Inchoo/Coreextended/etc/config.xml (same analogy as above applies)
- And finally, create this file app/etc/modules/Inchoo_Coreextended.xml.