1

我试图在 Amasty shopby 模块中再添加一个自定义字段。为此,我需要覆盖 adminhtml 表单。我为此创建了模块,但这并没有覆盖现有模块。我必须覆盖“Amasty_Shopby_Block_Adminhtml_Filter_Edit_Tab_General”类。这是我的代码。

我的公司_我的模块.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Mycompany_Mymodule>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Amasty_Shopby />
                <Amasty_Base />
            </depends>
        </Mycompany_Mymodule>
    </modules>
</config>

我的公司/我的模块/etc/config.xml

<config>
_____________
______________
    <global>
        <blocks>
            <adminhtml>
                 <rewrite>        <filter_edit_tab_general>Mycompany_Mymodule_Block_Adminhtml_Filter_Edit_Tab_General
                   </filter_edit_tab_general>
                 </rewrite>
            </adminhtml>
        </blocks>
    </global>
 ____________
-________________
</config>

Mycompany\Mymodule\Block\Adminhtml\Filter\Edit\Tab\General.php

public class Mycompany_Mymodule_Block_Adminhtml_Filter_Edit_Tab_General extends Amasty_Shopby_Block_Adminhtml_Filter_Edit_Tab_General
{
 _______________
___________
}
4

1 回答 1

3

您现在要覆盖的不是 Amasty 块,而是adminhtml/filter_edit_tab_general。因此,要重写Amasty_Shopby_Block_Adminhtml_Filter_Edit_Tab_General您需要以下配置:

<global>
    <blocks>
        <amshopby>
            <rewrite>
                <adminhtml_filter_edit_tab_general>Mycompany_Mymodule_Block_Adminhtml_Filter_Edit_Tab_General</adminhtml_filter_edit_tab_general>
            </rewrite>
        </amshopby>
    </blocks>
</global>
于 2013-05-02T13:35:14.743 回答