1

This is My Config.xml

<?xml version="1.0"?>
<config>
 <modules>
        <Modulename_PrintPdf>
            <version>1.0.0</version>
        </Modulename_PrintPdf>
    </modules>
    <global>
        <models>
            <ordermanager>
                <rewrite>
                    <observer>Modulename__PrintPdf_Model_Observer</observer>
                </rewrite>
            </ordermanager>
        </models>
    </global>

     <admin>
        <routers>
            <ordermanager>
                <args>
                    <modules>
                   <Modulename__PrintPdf before="Fooman_OrderManager">Modulename__PrintPdf</Modulename__PrintPdf>
                     </modules>
                </args>
            </ordermanager>
        </routers>
    </admin>
</config>

This is My controller in local folder

Mage::log("override");
require('Fooman/OrderManager/controllers/Sales/OrderManagerController.php');

class Modulename__PrintPdf_OrderManagerController extends Fooman_OrderManager_Sales_OrderManagerController
{

        public function indexAction()
            {
                Mage::log("hello"); 
            }

}

this is my true file

<?xml version="1.0"?>
<config>
    <modules>
        <Modulename__PrintPdf>
            <active>false</active>
            <codePool>local</codePool>
            <depends>
                <Fooman_OrderManager/>
            </depends>
        </Modulename_PrintPdf>
    </modules>
</config>

but now working

3 Answers 3

2

I think It's because of the two underscores between Modulename and PrintPdf, you should have Modulename_PrintPdf.

1

Your class needs to match the request path of:

site.com/{fooman frontname}/sales/ordermanager/index
--------------------------{                         }

Which means that your class needs to be Modulename__PrintPdf_Sales_OrderManagerController and in the proper location.

1

Follow bellow steps

Step : 1 (app\etc\modules\Modulename_PrintPdf.xml)

<?xml version="1.0"?>
<config>
    <modules>
        <Modulename_PrintPdf>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Fooman_OrderManager/>
            </depends>
        </Modulename_PrintPdf>
    </modules>
</config>

Step : 2 (app\code\local\Modulename\PrintPdf\etc\config.xml)

<?xml version="1.0"?>
<config>
 <modules>
        <Modulename_PrintPdf>
            <version>1.0.0</version>
        </Modulename_PrintPdf>
    </modules>
    <global>
        <models>
            <ordermanager>
                <rewrite>
                    <observer>Modulename_PrintPdf_Model_Observer</observer>
                </rewrite>
            </ordermanager>
        </models>
    </global>
    <admin>
        <routers>
            <ordermanager>
                <args>
                    <modules>
                        <Modulename_PrintPdf before="Fooman_OrderManager">Modulename_PrintPdf</Modulename_PrintPdf>
                     </modules>
                </args>
            </ordermanager>
        </routers>
    </admin>
</config>

Step : 3 (app\code\local\Modulename\PrintPdf\Sales\OrderManagerController.php)

<?php
require('Fooman/OrderManager/controllers/Sales/OrderManagerController.php');

class Modulename_PrintPdf_Sales_OrderManagerController extends Fooman_OrderManager_Sales_OrderManagerController
{
    public function indexAction()
    {
        Mage::log("hello"); 
    }

}
1
  • thx but it still not working after adding sales
    – imtiaz
    Dec 10, 2015 at 5:10

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.