开发者

Magento Overriding Model

开发者 https://www.devze.com 2023-03-17 17:20 出处:网络
As part of a wider project, I am trying to overwrite the core class Mage_Sales_Model_Order_Payment.I am editing a config.xml file that is part of an already active module.

As part of a wider project, I am trying to overwrite the core class Mage_Sales_Model_Order_Payment. I am editing a config.xml file that is part of an already active module.

<config>
  <global>
    <models>
       <sales>
         <rewrite>
    <order_payment>MyNamespace_MyModule_Model_Payment</order_payment>
     </rewrite>
   </sales>
    </models>
  </global>
 <config>

The class I am trying to replace is in the directory:

app/code/local/MyNamespace/MyModule/Model/Pay开发者_C百科ment.php

It is called MyNamespace_Sales_Model_Order_Payment.

Currently, no overwriting seems to take place and the core class functions seem to be used. Any help would be very useful.

Thank you.


The name of the class must match the file it's in. In this case it should be called MyNamespace_MyModule_Model_Payment

0

精彩评论

暂无评论...
验证码 换一张
取 消