3

How can I rewrite Mage_Core_Controller_Varien_Front?
I have already tried the way we rewrite controllers but it is not working.
ADDED CODE

<frontend>
        <routers>
            <core>
                <use>standard</use>
                <args>
                    <modules>
                        <Custom_Front before="Mage_Core">Custom_Front</Custom_Front>
                    </modules>
                </args>
            </core>
        </routers>
    </frontend>
  • paste your code in question what you tried. – liyakat Apr 27 '15 at 6:12
  • @liyakat I have added the code that I have used to rewrite in config.xml – Anshu Mishra Apr 27 '15 at 6:25
4

You can't. The class is instantiated by name, not by magento factory, therefore you can only overwrite the whole class by copying it to app/code/local/Mage/....

// \Mage_Core_Model_App::_initFrontController
// app/code/core/Mage/Core/Model/App.php:744
$this->_frontController = new Mage_Core_Controller_Varien_Front();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.