I am trying to override Mage_Sales_Model_Resource_Order_Collection

My custom module's config:

<?xml version="1.0" encoding="UTF-8"?>






            <!-- HERE is i am trying to override-->





It's not giving me any kind of error even if I place the wrong custom class name. So it's not finding my custom class.

Please help

  • 2
    Your xml looks fine to me. Possible that is already rewritten by another 3rd party module? To check for rewrite conflicts, get this github.com/firegento/firegento-debug and check for rewrite conflicts
    – ProxiBlue
    Commented Aug 12, 2013 at 6:45
  • @Proxiblue I have tried disabling all the extensions. And firegento is showing status ok for sales_resource/order_collection Commented Aug 13, 2013 at 1:16

1 Answer 1


The single most important place to debug a Magento rewrite is right here

#File: app/code/core/Mage/Core/Model/Config.php
public function getGroupedClassName($groupType, $classId, $groupRootNode=null)
    $config = $this->_xml->global->{$groupType.'s'}->{$group};

    // First - check maybe the entity class was rewritten
    $className = null;
    if (isset($config->rewrite->$class)) {
        $className = (string)$config->rewrite->$class;
    } else {
         * Backwards compatibility for pre-MMDB extensions.
         * In MMDB release resource nodes <..._mysql4> were renamed to <..._resource>. So <deprecatedNode> is left
         * to keep name of previously used nodes, that still may be used by non-updated extensions.
        if ($config->deprecatedNode) {
            $deprecatedNode = $config->deprecatedNode;
            $configOld = $this->_xml->global->{$groupType.'s'}->$deprecatedNode;
            if (isset($configOld->rewrite->$class)) {
                $className = (string) $configOld->rewrite->$class;


This is where Magento dives into your configuration to look for a rewrite node, and if it finds one, rewrite the class. Add some temporary conditional debugging code here that prints or logs the information Magento's fetching from the config and you'll get the bottom of most rewrite problems.

  • I checked using this but my custom class is not showing, all ohter over riding classes are showing from other modules. It is just not taking into account sale_resouce node or the deprecatedNode. Thats the weirdest thing I've come accross. I also tried disabling all the other modules in local. Still no luck. My xml in config and etc/module is also all correct Commented Aug 13, 2013 at 5:12
  • @RIK when $group is equal to 'sale_resouce', what's the contents of $config->asXml()? Does the output of asXml include your rewrite XML? Commented Aug 13, 2013 at 6:54

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.