models
下的節點應該與app\code\community\Dhl\Intraship\etc\config.xml
同一個:
<?xml version="1.0"?>
<config>
<modules>
<Dhl_Intraship>
<version>13.07.04</version>
</Dhl_Intraship>
</modules>
<!-- some more code here -->
<global>
<models>
<intraship> <!-- this is the node you have to look at -->
<class>Dhl_Intraship_Model</class>
<resourceModel>intraship_mysql4</resourceModel>
</intraship>
<!-- some more code here -->
</models>
<!-- some more code here -->
<global>
</config>
而且rewrite
下的節點已經以適應所要的文件夾模式下的改寫文件的路徑:所以在你區分它只是gateway
。但如果你是重寫app\code\community\Dhl\Intraship\Model\Path\To\Some\Model.php
節點會一直path_to_some_model
所以它應該看起來像這樣:
<?xml version="1.0"?>
<config>
<modules>
<mycompany_intraship>
<version>0.1.0</version>
</mycompany_intraship >
</modules>
<global>
<models>
<intraship>
<rewrite>
<gateway>MyCompany_Intraship_Model_Gateway</gateway>
</rewrite>
</intraship>
</models>
</global>
</config>
感謝@ b.enoit.be - 這正是我一直在尋找的解釋和幫助我嘗試了幾個小時後。 – Torben