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

Overload customerController
 
nicolas46
Sr. Member
 
Total Posts:  210
Joined:  2008-04-09
Toulouse
 

Hello
I’m trying to overload the function saveAction() of CustomerController.php (adminhtml/controllers/), i readed the tuto in the wiki ("Overload a controller") but i have a problem

I create the file CustomerController.php here: local/MaBoite/MonModule/controllers/

There is my config.xml file:

<?xml version="1.0"?>
<config>
    <
modules>
        <
MaBoite_MonModule>
            <
version>0.1</version>            
        </
MaBoite_MonModule>     
    </
modules>
    <global>               
        <
rewrite>
            <
maboite_monmodule_customer>           
               <
from><![CDATA[#^admin/customer/$#]]></from>
                
<to>/attrcustomer/customer</to>
            </
maboite_monmodule_customer>
        </
rewrite>    
   </global>                     
   <
admin>
        <
routers>
            <
monmodule>
                <use>
admin</use>
                <
args>
                     <
module>MaBoite_MonModule</module>
                     <
frontName>MaBoite_MonModule</frontName>
                </
args>
            </
monmodule>
        </
routers>
    </
admin>
</
config>

I think my problem is in my tag “rewrite\” but i can’t find what i’m doing wrong. 

Any ideas please ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
asrenzo
Member
 
Avatar
Total Posts:  42
Joined:  2008-02-25
France
 

Hi,

I also need to overload an admin controller and I’m stucked with my custom file not being loaded. I searched the forums for such a recipe but I did not find anything working even if many people seem to have this kind of need.

Could any team member post a simple tutorial on how to overload customerController ??

Regards,

Laurent

 
Magento Community Magento Community
Magento Community
Magento Community
 
nicolas46
Sr. Member
 
Total Posts:  210
Joined:  2008-04-09
Toulouse
 

I manage to solve my problem :
for me it was just to overload the saveAction method

<?xml version="1.0"?>
<config>
    <
modules>
        <
Myfirm_AttrCustomer>
            <
version>0.1</version>            
        </
Myfirm_AttrCustomer>
         
       
    </
modules>
    <global>
        
        <!--  
controllers   -->
        
        <
rewrite>
            <
myfirm_attrcustomer_adminhtml_customer>
              <
from><![CDATA[#^/admin/customer/save/#]]></from>    
                
<to>/attrcustomer/adminhtml_customer/save/</to>
            </
myfirm_attrcustomer_adminhtml_customer>
        </
rewrite>
   
    </global>
    

      <
admin>
        <
routers>
            <
myfirm_attrcustomer>                
                <use>
admin</use>
                <
args>
                    <
module>Myfirm_AttrCustomer</module>
                
                    <
frontName>attrcustomer</frontName>
                </
args>
            </
myfirm_attrcustomer>
        </
routers>
    </
admin>
</
config>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top