[英]Magento - Override the tablerate resource model
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 Magento版本:1.7
I would like to rewrite the the Mage_Shipping_Model_Resource_Carrier_Tablerate class found at: 我想重写在以下位置找到的Mage_Shipping_Model_Resource_Carrier_Tablerate类:
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: 我已经创建了应用程序的/ etc /模块/ me_Shipping.xml一个文件,其中包含:
<?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 最后,我在以下目录中创建了一个config.xml: 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 提前致谢
<shipping_resource>
<rewrite>
<carrier_tablerate>me_Shipping_Model_Resource_Carrier_Tablerate</carrier_tablerate>
</rewrite>
</shipping_resource>
This resolves the issue 这样可以解决问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.