1

我很难配置此块覆盖,但它不起作用。谁能帮我找出问题所在。

等/config.xml

<config>
<modules>
        <Sbm_Relatorio>
        <version>0.1.0</version>
    </Sbm_Relatorio>
</modules>    

<global>
    <helpers>
        <relatorio>
            <class>Sbm_Relatorio_Helper</class>
        </relatorio>
    </helpers>
    <blocks>
        <sales>
            <rewrite>
                <adminhtml_report_filter_form>Sbm_Relatorio_Block_Adminhtml_Report_Filter_Form</adminhtml_report_filter_form>
            </rewrite>
        </sales>
    </blocks>        
</global>

块/Adminhtml/Report/Filter/Form.php

class Sbm_Relatorio_Block_Adminhtml_Report_Filter_Form extends Mage_Sales_Block_Adminhtml_Report_Filter_Form {

protected function _prepareForm()
{ ... }

我已经尝试在此方法中添加和删除内容,但没有任何进展。看来我的覆盖配置出错了。

4

2 回答 2

1

此块已被 覆盖Mage_Sales_Block_Adminhtml_Report_Filter_Form_Order,因此这是您必须覆盖的块:
config.xml

    <blocks>
        <sales>
            <rewrite>
                <adminhtml_report_filter_form_order>Sbm_Relatorio_Block_Adminhtml_Report_Filter_Form</adminhtml_report_filter_form_order>
            </rewrite>
        </sales>
    </blocks>

和班级:

class Sbm_Relatorio_Block_Adminhtml_Report_Filter_Form extends Mage_Sales_Block_Adminhtml_Report_Filter_Form_Order
{
    protected function _prepareForm()
    {
        //your code here
    }
}
于 2013-10-09T07:11:01.383 回答
-1

试试这个:

<blocks>
  <adminhtml>
    <rewrite>
      <report_filter_form>Sbm_Relatorio_Block_Adminhtml_Report_Filter_Form</report_filter_form>
    </rewrite>
  </adminhtml>
</blocks>
于 2013-10-08T21:52:34.720 回答