1

I need to Override Mage/Adminhtml/controllers/Sales/Order/CreateController.php

Step 1:- I write in etc/config.xml

<admin>
   <routers>
       <adminhtml>
           <args>
               <modules>
                   <Mycompany_Mymodule before="Mage_Adminhtml">Mycompany_Mymodule_Adminhtml</Mycompany_Mymodule>
               </modules>
           </args>
       </adminhtml>
   </routers>

Step 2:- I put CreateController.php file on this location /var/www/magento/app/code/community/Mycompany/Mymodule/controllers/Adminhtml/Sales/Order

Step 3: I did changes in controller class name

class Mycompany_Mymodule_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Sales_Order_CreateController
{ }

I am unable to override by this implementation. Please, Help me to override this controller.

6
  • did you add the file app/etc/modules/Mycompany_Mymodule.xml?
    – Marius
    Nov 25, 2014 at 15:41
  • and do you get an error or just nothing happens? Nov 25, 2014 at 15:53
  • Yes, I added and it is working. Nov 25, 2014 at 16:02
  • @DavidManners I am not getting any error in log file. It just nothing happens. I have checked default CreateController.php is loading. Nov 25, 2014 at 16:11
  • @PranavKrMurari you controller has no code in it so it will simply call the original controller or am I missing something? Nov 25, 2014 at 16:25

1 Answer 1

1

You need to include the admin controller class you are extending off - it doesn't get auto included in controllers:

include_once("Mage/Adminhtml/controllers/Sales/Order/CreateController.php");
class Mycompany_Mymodule_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Sales_Order_CreateController
{ }
3
  • Thanks for your suggestion but still no luck. Nov 26, 2014 at 9:49
  • Double check all of your syntax, my guess is something is not declared correctly or you have a typo somewhere. Nov 26, 2014 at 10:26
  • @All Thanks for your valuable suggestion. There was class conflict. CreateController was called in another also. I have resolved my issue. Dec 1, 2014 at 8:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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