Search code examples
magentomagento-1.5

Rewriting the admin sales report form


In my config file I can easily override the sales -> order grid with my own doing this

<blocks>
  <adminhtml>
    <rewrite>
      <sales_order_grid>Mine here</sales_order_grid>
    </rewrite>
  </adminhtml>
</blocks>

But I cannot seem to do the same for the report_filter_form which is on the Reports->Sales->Order menu item. If I replace the above rewrite content with

<report_filter_form>mine here</report_filter_form>

Is this one a special case or something. I've cleared my cache and have no luck. The block is loaded in the controller by doing a ->getBlock('grid.filter.form') then feeding it into a initReportAction and finally rendering the layout.


Solution

  • Looking in the layout files I see this:

    <block type="sales/adminhtml_report_filter_form_order" name="grid.filter.form">
    

    So the block that needs overwriting is sales/adminhtml_report_filter_form_order,

    <blocks>
      <sales>
        <rewrite>
          <adminhtml_report_filter_form_order>Mine here</adminhtml_report_filter_form_order>
        </rewrite>
      </sales>
    </blocks>