I need to override a core controller's preDispatch method. The core controller inherits from
Mage_Checkout_Controller_Action, which itself has a preDispatch method that needs to be called. Since I'm extending from the core controller I want to override, I cannot just call
parent::preDispatch(), since that would pull in functionality that I'm trying to avoid.
My question is - How can I call an overridden method that is 2 levels higher in the inheritance chain, or am I just going about this the wrong way?
Apparently this works:
Mage_Checkout_Controller_Action::preDispatch(); (even though that method is not static, I guess you learn something new every day..)
Now my question is: Is there a better way of doing this without having to copy in all functionality from the class I am overridding?
The reason I am attempting this is because I was going down this path, attempting to force Magento to remember address assignments when customers go through multishipping checkout and then subsequently leave. (FWIW, I found the linked to article great for getting me going in the right direction, but there seems to be a lot missing as far as steps that need to be taken to get this to work).
The controller I'm overriding is the core MultiShippingController which has a redirect back to the Multishipping IndexAction that needs to be avoided. On a somewhat side-note, I have gotten this functionality mostly complete, save for a few issues (relating to the adding of the first item to the cart and the Mage_Sales_Model_Quote_Item->getQuoteItem() returning null in the addresses.phtml template, though that is an entirely different discussion).