2

I am trying to add a block to the admin create order screen. Im my layout xml I have

    <adminhtml_sales_order_create_index>
    <reference name="head">
        <action method="addItem"><type>skin_js</type><name>js/fee/fee.js</name></action>
    </reference> 
    <reference name="data">
             <block type="fee/adminhtml_insuranceselector" after="shipping_method" name="fee.insurance" template="fee/sales/order/insuranceselector.phtml" />
    </reference>
</adminhtml_sales_order_create_index>

<adminhtml_sales_order_create_load_block_data>
    <reference name="data">
             <block type="fee/adminhtml_insuranceselector" after="shipping_method" name="fee.insurance" template="fee/sales/order/insuranceselector.phtml" />
    </reference>
</adminhtml_sales_order_create_load_block_data>

The block does not show up at all with reference of "data" or even "content", if I change the reference to say "left" it shows up but I really need it in the data area under the shipping method. The content reference doesn't have a template file so I don't see a need to echo a child block. Not sure what I am doing wrong. Any pointers would be appreciated.

Dylan Orr
  • 69
  • 1
  • 5
  • Although completely unrelated - this post helped me understand why on initial load of an order create I was unable to see my overrides, but on refreshing the page i was able to. Including adminhtml_sales_order_create_load_block_data in addition to admin_html_sales_order_create_index solved my problem! – josh.chavanne Feb 05 '15 at 23:30
  • @Dylan . can u please explain me more.actually i m new in magento.i am doing the same but didnt get any response.if i change to then its shows response. – shilpi Singh Jun 23 '16 at 11:29
  • 1
    There actually is a template for the data block that I was not seeing, its its located here: app/design/adminhtml/default/default/template/sales/order/create/data.phtml You will need to edit or, or best practice is to overwrite it by copying it to your theme directory. The you will need to call $this->getChildHtml('blockName') – Dylan Orr Jun 24 '16 at 15:24
  • thanks a ton .. :-) :-) – shilpi Singh Jun 29 '16 at 16:41

1 Answers1

3

The data block does not display all its children anonymously, you can check its template file (app/design/adminhtml/default/default/template/sales/order/create/data.phtml) to see how it's actually working.

To display your own block below the shipping methods, you will need to apply your own template, based on the original, to the data block, and to add a corresponding getChildHtml call where you want it to be displayed.

blmage
  • 4,214
  • 1
  • 23
  • 25