如何在现有的第三方扩展中重写/扩展Magento类 [英] How to rewrite/extend a Magento class in an existing third party extension
问题描述
我正在尝试扩展第三方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屋!