Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Controller Overriding Problems
 
lemattma
Jr. Member
 
Total Posts:  5
Joined:  2009-06-17
Santiago, Chile
 

FIRST OF ALL, I HAVE GOOGLED ALL DAY LONG, AND NOW I’M DESPERATE:

I can’t get my module to override a controller:

Original controller:
community/Unirgy/Dropship/controllers/Adminhtml/vendorController.php

My controller:
local/TCN/Vendor/controllers/Adminhtml/vendorController.php

<global>
  <
routers>
    <
udropship>
      <
rewrite>
        <
adminhtml_vendor>
          <
to>TCN_Vendor/adminhtml_vendor</to>
          <
override_actions>true</override_actions>
          <
actions>
            <
save><to>TCN_Vendor/adminhtml_vendor/save</to></save>
          </
actions>
        </
adminhtml_vendor>
      </
rewrite>
    </
udropship>
  </
routers>
</global>

Now I’m not sure with the following (I put test cause i read that this name has to be unique, so I put test for now):

<admin>
  <
routers>
    <
test>
      <use>
admin</use>
      <
args>
        <
module>TCN_Vendor</module>
        <
frontName>test</frontName>
      </
args>
    </
test>
  </
routers>
</
admin>

Please, any idea? blank stare

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

Try this method http://www.magentocommerce.com/boards/viewthread/25942/#t147306

 
Magento Community Magento Community
Magento Community
Magento Community
 
lemattma
Jr. Member
 
Total Posts:  5
Joined:  2009-06-17
Santiago, Chile
 

So, I have this:

<admin>
  <
routers>
    <
adminhtml>
      <
args>
        <
modules>
          <
TCN_Vendor before="udropship">TCN_Vendor_Adminhtml_VendorController</TCN_Vendor>
        </
modules>
      </
args>
    </
adminhtml>
  </
routers>
</
admin>

but is not working.. I just want the controller process to run MY OWN saveAction instead the ‘original’ one. It’s so complicated. I’ve seen at least 4 ways to do it and I’m still struggling!!

udropship is the module
Original class is Unirgy_Dropship_Adminhtml_VendorController
My own class is TCN_Vendor_Adminhtml_VendorController

include("Unirgy/Dropship/Adminhtml/VendorController.php");
class 
TCN_Vendor_Adminhtml_VendorController extends Unirgy_Dropship_Adminhtml_VendorController{
  
public function saveAction()
  
{
    
// ...
  
}
}

help me please!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top