I am starting a new question for this because I created a clean magento install and still can't get any overwrites to work for the controllers. My edits for models and blocks all work fine but I have not been able to get it to work for the controller.
Could this be an issue with Magento 1.9 specifically? Are there new requirements to configure? All the examples and tutorials are based on an older version.
Here is what i have so far:
app/code/local/Paypalextended/Checkout/controllers/OnepageController.php
<?php
# Controllers are not autoloaded so we will have to do it manually:
require_once 'Mage/Checkout/controllers/OnepageController.php';
class Paypalextended_Checkout_OnepageController extends Mage_Checkout_OnepageController
{
public function indexAction(){
echo 'Hello World';
}
}
app/code/local/Paypalextended/Checkout/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Paypalextended_Checkout>
<version>0.1.0</version>
</Paypalextended_Checkout>
</modules>
<!--
If you want to overload an admin controller this tag should be <admin> instead,
or <adminhtml> if youre overloading such stuff (?)
-->
<frontend>
<routers>
<checkout>
<args>
<modules>
<Paypalextended_Checkout before="Mage_Checkout">Paypalextended_Checkout</Paypalextended_Checkout>
</modules>
</args>
</checkout>
</routers>
</frontend>
</config>
app/etc/modules/Paypalextended_All.xml
<?xml version="1.0"?>
<config>
<modules>
<Paypalextended_Checkout>
<active>true</active>
<codePool>local</codePool>
</Paypalextended_Checkout>
</modules>
</config>
As I mentioned this is on a brand new install so there should be nothing interfering. Still it doesnt work. Is there a setting needed somewhere to allow controller overwrites?
I have tried moving the folder location to:
app/code/local/Paypalextended/Checkout/controllers/Checkout/OnepageController.php
and changing all the references appropriately. I saw this in a couple different tutorials. I tried everything in the wiki including the rewrite method and still nothing. I have made dozens of config.xml edits, instead of require_once include_once, changing the require_once line to:
require_once Mage::getModuleDir('controllers', "Mage_Checkout").DS."OnepageController.php";
I am beginning to think the problem is something specific to magento 1.9, has anyone ran into this or has successfully done a controller overwrite in magento 1.9? All advice appreciated!!!!
---------------------------------ANSWER-------------------------------------- So the problem ended up being that I had a leading empty line in my config.xml file... After that was removed both methods listed below worked perfectly. BIG thanks to Amit for his assistance!