I try to overwrite the Exportorders.php in my extension which is located here:


I created my own extension now in /app/code/local/Namespace/Raveinfosys/Exporter/

and added the Namespace_Raveinfosys_Exporter.xml to /app/etc/modules/.

Within /Exporter/ I created two folders: /etc/ and /Model/. Within /etc/ I placed the config xml with the following contents:

<?xml version="1.0"?>

Within the /Model/ folder I created copied the Exportorders.php and put in the first line:

class Namespace_Raveinfosys_Exporter_Model_Exportorders extends Raveinfosys_Exporter_Model_Exportorders

But somehow it is not working. Does anybody know why it is not working? Is it a problem that the /etc/ Folder are in the 2nd level? They are not in Namespace/Exporter, they are in Namespace/Raveinfosys/Exporter.

  • "Is it a problem that the /etc/ Folder are in the 2nd level?" - Yes
    – changeling
    Aug 3 '15 at 20:57

Magento expects modules to have the following structure:


Certain components of the module architecture (specifically controllers and etc contents must be in a specific hierarchy. Your module violates these expectations, and that's why it doesn't work.

Also, there are two general ways to change class behaviors (excluding event observers). The preferred way is a configured class rewrite, in which you designate a different class to instantiate when some other class is requested. The less-preferred way is to inject your own definition of a class via autoloading precedence (this can be done without creating a new module). You seem to be conflating the two with your solution.

  • Thanks - do you know a good resource that explains what you try to say in terms of these 2 ways? I do not know if I understood it completely. I now removed the second folder level "Exporter" from my extension and moved the /etc/ and /model/ folder to Namespace/Raveinfosys and changed the XML structure (I removed the exporter from there as well) but still my class in exportorders.php is not taken from Magento... do you have another hint for me? Would be great.
    – Torben
    Aug 6 '15 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.