0

I can't override the controller inside of the Enterprise/GiftCardAccount/controllers/Adminhtml/ folder

<config>
...

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Vendor_Module before="Enterprise_GiftCardAccount">Vendor_Module_Adminhtml</Vendor_Module>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>
...
</config>

Note: I also tried with before="Mage_Adminhtml" value and nothing

Then I created the controller in my module folder

app/code/local/Vendor/Module/controllers/Adminhtml/GiftcardaccountController.php

The code in the controller

<?php

require_once 'Enterprise/GiftCardAccount/controllers/Adminhtml/GiftcardaccountController.php';
//require_once Mage::getModuleDir('controllers', 'Enterprise_GiftCardAccount').DS.'Adminhtml'.DS.'GiftcardaccountController.php';

class Vendor_Module_Adminhtml_GiftcardaccountController extends Enterprise_GiftCardAccount_Adminhtml_GiftcardaccountController
{}
2
  • Does it show any error or what? Commented Aug 17, 2021 at 5:53
  • @DhirenVasoya No errors or logs. But, I can fixed the issue and I just posted the answer. Commented Aug 17, 2021 at 15:49

1 Answer 1

0

This is the correct config.xml

<config>
...

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Vendor_Module before="Enterprise_GiftCardAccount_Adminhtml">Vendor_Module_Adminhtml</Vendor_Module>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>
...
</config>

Note: the "_Adminhtml" at the end in the before value

app/code/local/Vendor/Module/controllers/Adminhtml/GiftcardaccountController.php

Then in the controller use this code

<?php

require_once Mage::getModuleDir('controllers', 'Enterprise_GiftCardAccount').DS.'Adminhtml'.DS.'GiftcardaccountController.php';

class Vendor_Module_Adminhtml_GiftcardaccountController extends Enterprise_GiftCardAccount_Adminhtml_GiftcardaccountController
{
...

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.