无法覆盖Mage_Sales_Model_Order [英] Can't override Mage_Sales_Model_Order

查看:69
本文介绍了无法覆盖Mage_Sales_Model_Order的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在config.xml中有这样的部分

I have such section in config.xml

<global>        
    <models>
        <sales>
            <rewrite>
                <order>Apptha_Reservation_Model_Order</order>                   
            </rewrite>
        </sales>
    </models>
</global>

此外,我还从此处 http://alanstorm.com/magento_config 下载了Alan Strom配置查看器. 但是当我检查myhost.com/?showConfig=true时,看不到新的重写规则.

In addition, I have download Alan Strom config viewer from here http://alanstorm.com/magento_config but when I check myhost.com/?showConfig=true, I don't see my new rewrite rule.

推荐答案

当模块配置未合并到Magento的配置DOM中时,有以下三种可能性:

There are three possibilities when module configuration is not being merged into Magento's configuration DOM:

  1. 正在缓存配置.通过刷新系统>缓存管理
  2. 中的所有内容来清除它
  3. 由于模块声明不正确或路径不正确,无法解析模块的 config.xml .
  4. global/disable_local_modules设置为1true-通常,请参见app/etc/local.xml,但是唯一可以确定的方法是检查整个DOM.
  1. Configuration is being cached. Clear it by flushing all in System > Cache Management
  2. Your module's config.xml is not being parsed due to incorrect module declaration or incorrect path.
  3. global/disable_local_modules is set to 1 or true - in general, see app/etc/local.xml, but the only way to know for sure is to inspect the full DOM.

对于(2),仅在清除配置缓存后才应进行故障排除.然后,检查要解析为配置DOM的模块 config.xml 文件的每个条件:

In the case of (2), troubleshooting should occur only after config cache has been cleared. Then, check each of the conditions for your module's config.xml file to be parsed into the configuration DOM:

  1. 正确的模块声明:一个名称以".xml"结尾的文件,其中包含 app/etc/ app/etc/modules/中存在的有效XML语法(按照惯例,是后者).
  2. 该模块包含以下结构(当前SO无法正确显示这些结构; 请参见要点):

  1. Correct module declaration: an file with a name ending in ".xml" containing valid XML syntax present in app/etc/ or in app/etc/modules/ (by convention, it's the latter).
  2. The module contains structure as follows (currently SO is not displaying these correctly; see gist instead):

真的 当地的

true local

基于上述配置,配置文件必须必须位于 app/code/local/Module/Path/etc/config.xml 中,并且必须包含有效的XML语法以便进行解析.

Based on the above configuration, the config file must be located at app/code/local/Module/Path/etc/config.xml and must contain valid XML syntax in order to be parsed.

如果模块声明和文件路径正确,则可能是语法无效.这可以通过设置开发人员模式标志并确保PHP显示错误来确定(请参见 index.php ).

Provided that module declaration and file paths are correct, the likely culprit is invalid syntax. This can be determined by setting the developer mode flag and ensuring that PHP is displaying errors (see index.php).

这篇关于无法覆盖Mage_Sales_Model_Order的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆