如何在现有的第三方扩展中重写/扩展Magento类 [英] How to rewrite/extend a Magento class in an existing third party extension

查看:40
本文介绍了如何在现有的第三方扩展中重写/扩展Magento类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试扩展第三方Magento扩展的类.

I'm trying to extend the class of a third party Magento extension.

我的模块xml:

在config> modules>标记内

within config>modules> tags

<EDPA_MegaNavigation>

        <active>true</active>

        <codePool>local</codePool>

        <depends>
            <Infortis_UltraMegamenu />
        </depends>

    </EDPA_MegaNavigation>

我的配置xml:

在config> global> blocks>标记内

within config>global>blocks> tags

 <ultramegamenu>

       <rewrite>

           <Infortis_UltraMegamenu_Block_Navigation>EDPA_MegaNavigation_Block_Navigation</Infortis_UltraMegamenu_Block_Navigation>

       </rewrite>

   </ultramegamenu>

我的扩展课程(Navigation.php)具有

My extended class (Navigation.php) has

class EDPA_MegaNavigation_Block_Navigation extends Infortis_UltraMegamenu_Block_Navigation
{
########
}

在系统内>配置>列出了高级EDPA_MegaNavigation并显示为已启用.

Within system>configuration>advanced EDPA_MegaNavigation is listed and shows as enabled.

Infortis> UltraMegamenu>块中我的目标Navigation.php未被重写.

My target navigation.php within Infortis>UltraMegamenu>Block is not being rewritten.

非常感谢任何帮助/指导.

Any help/guidance much appreciated.

推荐答案

此处的问题如果Infortis_UltraMegamenu模块块标记为 ultramegamenu ,则

Here the issue in if Infortis_UltraMegamenu module block tag is ultramegamenu then

<ultramegamenu>

       <rewrite>

           <navigation>EDPA_MegaNavigation_Block_Navigation</navigation>

       </rewrite>

   </ultramegamenu>

这篇关于如何在现有的第三方扩展中重写/扩展Magento类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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