0

I am trying to override Magento Core CartController, But the core CartController is loading config.xml (inside community/Company/BnOverride/etc/)

<?xml version="1.0"?>
<config>
    <modules>
        <Company_BnOverride>
            <version>0.1.0</version>
        </Company_BnOverride>
    </modules>
    <frontend>
        <routers>
          <checkout>
                <args>
                    <modules>
                        <company_bnoverride before="Mage_Checkout">Company_BnOverride</company_bnoverride>
                    </modules>
                </args>
           </checkout>
        </routers>
    </frontend>
</config>

CartController.php inside (community/Company/BnOverride/controllers/)

<?php 
require_once 'Mage/Checkout/controllers/CartController.php';
class Company_BnOverride_CartController extends Mage_Checkout_CartController
{
    /**
     * Shopping cart display action
     */
    public function indexAction()
    {

        echo "Cart page";
        exit;
 }

And Company_BnOverride.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Company_BnOverride>
            <active>true</active>
            <codePool>community</codePool>
        </Company_BnOverride>
    </modules>
</config>
0

Replace Code in Config.xml file with :

<checkout>
     <args>
         <modules>
             <Company_Bnoverride before="Mage_Checkout">Company_BnOverride</Company_Bnoverride>
         </modules>
     </args>
 </checkout>

Also Replace Company_BnOverride.xml File

<?xml version="1.0"?>
<config>
    <modules>
        <Company_BnOverride>
            <active>true</active>
            <codePool>community</codePool>
        </Company_BnOverride>
    </modules>
</config>
  • Thank you for your response. I made the changes but still not loading the extended controller – user2638108 Jan 3 '17 at 11:03
  • Go for the Edited Answer – H_Parekh Jan 3 '17 at 11:04
  • Edited : config.xml file go for that. – H_Parekh Jan 3 '17 at 11:17
  • 1
    @user2638108:you can also upvote my answer – H_Parekh Jan 3 '17 at 12:38
2

change

<company_bnoverride before="Mage_Checkout_Cart">Company_BnOverride</company_bnoverride>

to

<company_bnoverride before="Mage_Checkout">Company_BnOverride</company_bnoverride>
0

Replace your controller frontend xml code with below one,

 <frontend>
       <routers>
           <checkout>
                 <args>
                     <modules>
                         <company_bnoverride before="Mage_Checkout">Company_BnOverride</company_bnoverride>
                      </modules>
                 </args>
           </checkout>
       </routers>
 </frontend>

You have to keep only Mage_Checkout instead of Mage_Checkout_Cart

Just keep Module name declaration of override module. Here in your case is checkout module.

  • Thank you for your response. I made the changes but still not loading the extended controller – user2638108 Jan 3 '17 at 11:02
  • <mage_checkout before="Mage_Checkout">Company_BnOverride</mage_checkout> try with this – Rakesh Jesadiya Jan 3 '17 at 11:06
  • You can close this question after accept any one answer. Thanks. – Rakesh Jesadiya Jan 3 '17 at 11:14

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.