Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8957957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:06:49+00:00 2026-06-15T15:06:49+00:00

I am trying to override an Ajax controller in Magento community module. The problem

  • 0

I am trying to override an Ajax controller in Magento community module. The problem is that my controller gets called only if the method doesn’t exist. I can’t override any of the overridden controller methods.

Here is my code

config.xml:

<frontend>
    <routers>
        <overriden_module>
            <args>
                <modules>
                    <My_Module before="Overriden_Module">My_Module</My_Module>
                </modules>
            </args>
        </overriden_module>
    </routers>
</frontend>

I am overriding an ajax controller so – AjaxController.php :

<?php
require_once (Mage::getModuleDir('controllers', 'Overriden_Module') . DS .'AjaxController.php');

class My_Module_AjaxController extends Overriden_Module_AjaxController {

//This is an overridden method and no hit
public function streetAction() {
    die('FOO');
}

// This action is not overridden and gets called
public function otherAction(){
    die('BAR')
}

}

As requested this is the router part from the module I’m overriding:

<routers>
        <module_name>
            <use>standard</use>
            <args>
                <module>Module_name</module>
                <frontName>frontname</frontName>
            </args>
        </module_name>
        <checkout>
            <args>
                <modules>
                    <Module_Name before="Mage_Checkout">Module_Name_Checkout</Module_Name>
                </modules>
            </args>
        </checkout>
    </routers>

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:06:50+00:00Added an answer on June 15, 2026 at 3:06 pm

    Ok after some debugging i found out what was causing the issue.
    The module i’m rewriting was also defining admin router with the same name as the frontend one. When Magento searches for a router match to dispatch it will first check the admin routers and therefore running the admin controller of the module and not even checking the front routers.

    If you dump $this->_routers in the code bellow you will see what i’m talking about.

    app/code/core/Mage/Core/Controller/Varien/Front.php line 174:

    while (!$request->isDispatched() && $i++<100) {
            foreach ($this->_routers as $router) {
                if ($router->match($this->getRequest())) {
                    break;
                }
            }
        }
    

    So the answer is to simply override the admin controller

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I'm trying to override Mage_Customer_AccountController, so that I can extend the createPostAction method.
I am trying to secure a controller action that is being called with the
I'm trying to override a method inside a jquery widget. The method can be
I ran into a problem today trying to override an implementation of an interface
I am trying to override the load() (abstract) method in org.primefaces.model.LazyDataModel class (from Primefaces
I am trying to write an AngularJS resource module that will post some data
I am trying to override the jQuery ajax function to handle a default action
Am trying to override get() method in my view as : broadcast = Broadcast.objects.get(request,
I have an ajax list that updates (as notifications). However, what I'm trying to
I'm trying to figure out how I can override the auth_views.logout method. Normally I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.