How to find all rewrite classes in magento
How to find all rewrite classes in magento

How to find all rewrite classes in magento is a difficult task for some developer who doesn’t know the proper way to check.Why I am saying like this because previously I was checking only by get_class() method of that class if there is any other class has rewrites it or not.But some developer do by searching individual module classes to check whether the specific classes has rewrites somewhere or not,yes it is right way but time consuming task some times it can make some mistakes as you are individually opening all files of module.Here I am going to show you how you can check if any class from models,blocks,helpers has overrides or not if overrides then where that overrides.All the solution is this tutorial.I will be showing you some sorts of techniques of How to find all rewrite classes in magento. Lets all techniques.

By get_class() methods:

Suppose I would like to rewrite Mage_Sales_Model_Quote_Address class before that I have to check whether this class already overridden or not it overridden then it will make difficult to override in my own custom module as magento doesn’t support multiple inheritance.why so ? because PHP does support hierarchical inheritance as Magneto is built upon PHP so this happens.

You can check by below code:

By xpath:

its will gives you all active rewrite classes.In same way if you like to check for models,blocks,helpers etc then see below codes.




Those are simple and single line techniques through which you will getting all rewrite classes like wise.

Custom script:

you can make it simply with any name called myScript.php and run it in browser like then you will be getting below result

The above result showing that the helper “catalog/image” is overridden by Namespace_Module_Helper_Catalog_Image.If there is two more values like above result then there is a conflict means two more module override the same class.

How to find all rewrite classes in magento
Tagged on:                     

Leave a Reply

Your email address will not be published.