问题
I have read through the various threads on here however i can still not get the following problem resolved. I am attempting to override a resource Model using the method below, however i am having no luck at all.
Magento Version: 1.7
I would like to rewrite the the Mage_Shipping_Model_Resource_Carrier_Tablerate class found at:
app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate
I have copied the file too:
app/code/local/me/Shipping/Model/Resource/Carrier/Tablerate.php
and renamed the class within the file to:
me_Shipping_Model_Resource_Carrier_Tablerate
I have created a file in app/etc/modules/me_Shipping.xml that contains:
<?xml version="1.0"?>
<config>
<modules>
<me_Shipping>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Shipping />
</depends>
</me_Shipping>
</modules>
</config>
Finally i have create a config.xml in: app/code/local/me/Shipping/etc/config.xml
I have tried many variations in this file, my latest is:
<?xml version="1.0"?>
<config>
<modules>
<me_Shipping>
<version>1.0</version>
</me_Shipping>
</modules>
<global>
<models>
<shipping>
<rewrite>
<resource_carrier_tablerate>me_Shipping_Model_Resource_Carrier_Tablerate</resource_carrier_tablerate>
</rewrite>
</shipping>
</models>
</global>
</config>
Thanks in advance
回答1:
<shipping_resource>
<rewrite>
<carrier_tablerate>me_Shipping_Model_Resource_Carrier_Tablerate</carrier_tablerate>
</rewrite>
</shipping_resource>
This resolves the issue
来源:https://stackoverflow.com/questions/12673185/magento-override-the-tablerate-resource-model