2013-10-08 117 views
1

我很難配置此塊覆蓋,但它沒有工作。任何人都可以幫我找到最新的錯誤。Magento塊覆蓋 - Report_Filter_Form

class Sbm_Relatorio_Block_Adminhtml_Report_Filter_Form extends Mage_Sales_Block_Adminhtml_Report_Filter_Form { 

protected function _prepareForm() 
{ ... } 

我已經嘗試過添加和這種方法但刪除內容

等/ 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 /報告/過濾/ form.php的沒有進展。看來我的覆蓋配置出錯了。

回答

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 
    } 
} 
+0

工程就像一個魅力!謝謝! –

+0

不要忘記接受答案 – OSdave

-1

嘗試用這個代替:

<blocks> 
    <adminhtml> 
    <rewrite> 
     <report_filter_form>Sbm_Relatorio_Block_Adminhtml_Report_Filter_Form</report_filter_form> 
    </rewrite> 
    </adminhtml> 
</blocks> 
+0

我會在明天工作。謝啦! –