I'm trying to override the successAction in the
app/code/core/Mage/Checkout/controllers/OnepageController.php.
I have done the following:
I've created my override folder here:
app/code/local/Ftml/Ig/controllers/OnepageController.php
I have a config file here:
app/code/local/Ftml/Ig/etc/config.xml
Here is the full XML of the config file. There are some other overrides here and an observer declared, and the observer is working, so I do believe that this file is being accessed and read:
<?xml version="1.0"?>
<config>
<modules>
<Ftml_Ig>
<version>0.0.1</version>
</Ftml_Ig>
</modules>
<global>
<models>
<ig>
<class>Ftml_Ig_Model</class>
</ig>
</models>
<helpers>
<ig>
<class>Ftml_Ig_Helper</class>
</ig>
</helpers>
<events>
<checkout_onepage_controller_success_action>
<observers>
<ig_sales_order_success_action>
<type>singleton</type>
<class>ig/observer</class>
<method>submitOrderData</method>
</ig_sales_order_success_action>
</observers>
</checkout_onepage_controller_success_action>
<cms_page_render>
<observers>
<ig_init_parameters>
<type>singleton</type>
<class>ig/observer</class>
<method>initParameters</method>
</ig_init_parameters>
</observers>
</cms_page_render>
</events>
</global>
<frontend>
<routers>
<ig>
<use>standard</use>
<args>
<module>Ftml_Ig</module>
<frontName>ig</frontName>
</args>
</ig>
<checkout>
<args>
<modules>
<ig before="Mage_Checkout">Ftml_Ig</ig>
</modules>
</args>
</checkout>
</routers>
</frontend>
<adminhtml>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<cloud>
<title>Cloud</title>
</cloud>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</adminhtml>
</config>
My module file is located in:
app/etc/modules/Ftml_Ig.xml
Here is the module XML:
<?xml version="1.0"?>
<config>
<modules>
<Ftml_Ig>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Page />
<Mage_Checkout />
</depends>
</Ftml_Ig>
</modules>
</config>
Finally, here is the code in my OnepageController.php file:
//require_once 'Mage/Checkout/controllers/OnepageController.php';
require_once(Mage::getModuleDir('controllers', 'Mage_Checkout').DS.'OnepageController.php');
class Ftml_Ig_OnepageController extends Mage_Checkout_OnepageController
{
/**
* Order success action
*/
public function successAction()
{
Mage::log("=^..^=In success action in OVERRIDE OnePageController");
$session = $this->getOnepage()->getCheckout();
if (!$session->getLastSuccessQuoteId()) {
$this->_redirect('checkout/cart');
return;
}
$lastQuoteId = $session->getLastQuoteId();
$lastOrderId = $session->getLastOrderId();
$lastRecurringProfiles = $session->getLastRecurringProfileIds();
if (!$lastQuoteId || (!$lastOrderId && empty($lastRecurringProfiles))) {
$this->_redirect('checkout/cart');
return;
}
$session->clear();
$this->loadLayout();
$this->_initLayoutMessages('checkout/session');
Mage::dispatchEvent('checkout_onepage_controller_success_action', array('order_ids' => array($lastOrderId)));
$this->renderLayout();
}
}
In the config.xml file, I have tried changing the (modules ig) to (ftml_ig), but that doesn't work. I've tried changing my require statement in the Overriding OnepageController.php from:
require_once 'Mage/Checkout/controllers/OnepageController.php';
to
require_once Mage::getModuleDir('controllers', 'Mage_Checkout').DS.'OnepageController.php'
But that seems to have had no effect either. I know that I'm still hitting the core because I'm not seeing log messages that I've added in the Overriding controller, and I AM seeing log messages that I added temporarily to the core controller. Any assistance with this issue would be greatly appreciated. I am new to Magento and PHP.
Edited to add more detail