Below a simple example of how to override a model from one module within another module.
Please take a look at the file app/code/local/Customweb/PostFinanceCw/etc/config.xml
for the correct use of the modulename namespace (which I can't read from your question, I used customweb_postfinancecw
for now).
You'd have to have a piece of XML like this in your module's config.xml
(I named it MyCompany_MyModule
, please replace it with your own)
<config>
<global>
<models>
<mycompany_mymodule>
<class>MyCompany_MyModule_Model</class>
</mycompany_mymodule>
<customweb_postfinancecw>
<rewrite>
<ordercontext>MyCompany_MyModule_Model_OrderContext</ordercontext>
</rewrite>
</customweb_postfinancecw>
</models>
</global>
</config>
Then, in app/code/local/MyCompany/MyModule/Model/
, create a file OrderContext.php
like this
class MyCompany_MyModule_Model_OrderContext extends Customweb_PostFinanceCw_Model_OrderContext
{
/* Override methods now */
}
You should name the methods exactly the same as in the original Customweb_PostFinanceCw_Model_OrderContext
class to override it's functionality. Also keep in mind to keep the same visibility (public, protected or private).