I want to overwrite Mage_Paypal_Model_Api_Nvp in my custom_module. For this, I have follow following steps but after that also core file is calling.




class Mycompany_Modulename_Model_Api_Nvp extends Mage_Paypal_Model_Api_Nvp
    <!-- Code -->

I have cleared cache, session, logs. But after that also my file is not called.

  • please check complier]
    – Amit Bera
    Jun 3 '15 at 17:53
  • compiler is not enabled.
    – Krupali
    Jun 3 '15 at 17:54
  • check class name by echo get_class(Mage::getModel('paypal/api_nvp')) is Mycompany_Modulename_Model_Api_Nvp. If it will given value Mycompany_Modulename_Model_Api_Nvp then the rewrite is proper
    – Amit Bera
    Jun 3 '15 at 17:56
  • core file is called :(
    – Krupali
    Jun 3 '15 at 18:01
  • Could you post the full config.xml fragment? The <models/> node should be inside <config><global>...
    – 7ochem
    Jun 3 '15 at 19:15

Your code definitely looks ok.

As the full config.xml file is missing here is what it should look like to ensure your rewrite works:


<?xml version="1.0"?>

Then you need to you ensure the path to your custom model is right, it should be app/code/local/Mycompany/Modulename/Model/Api/Nvp.php

Once you're done with that don't forget to:

  • recompile
  • flush the cache

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.