0

I want to add a custom block on sales order create page.

here is my code

<adminhtml_sales_order_create_index>

    <reference name="sidebar">
        <block type="adminhtml/template" name="verification" template="magentomod/ageverification/sales/order/create/comment.phtml"/>
    </reference>

</adminhtml_sales_order_create_index>
<adminhtml_sales_order_create_load_block_data>

    <reference name="sidebar">
        <block type="adminhtml/template" name="verification" template="magentomod/ageverification/sales/order/create/comment.phtml"/>
    </reference>

</adminhtml_sales_order_create_load_block_data>

Its work fine but if i change the reference from sidebar to content or data block it not work, i want to add this block within content block. and i dont want to change in core file of data.phtml. how do i create own data.phtml file..

lot of confusions.i gone though all the possible answers related to that Magento add block to sales order create .please help

Community
  • 1
  • 1
shilpi Singh
  • 402
  • 1
  • 5
  • 15

2 Answers2

1

You can just add output="toHtml" to you block for automaticaly render this block.

<adminhtml_sales_order_create_index>
    <reference name="content">
        <block type="adminhtml/template" name="verification" 
          template="magentomod/ageverification/sales/order/create/comment.phtml"
          output="toHtml" />
    </reference>
</adminhtml_sales_order_create_index>
<adminhtml_sales_order_create_load_block_data>
    <reference name="content">
        <block type="adminhtml/template" name="verification" 
             template="magentomod/ageverification/sales/order/create/comment.phtml"
             output="toHtml"
        />
    </reference>
</adminhtml_sales_order_create_load_block_data>

and I think you have custom theme, because content block have type list and all block inside him must be render automaticaly.

Naumov
  • 1,167
  • 9
  • 22
  • still not displayed..:( i think because of custom plugin...how do i find the problem and also its solution. – shilpi Singh Jun 24 '16 at 09:20
  • you can show `comment.phtml` may be you can not get needing data for `foreach` for example and you get empty output, you can set `` in first line `comment.phtml` for check loading your block or don't load. @shut why you type block `adminhtml/template` maybe you block should be `core/template`? – Naumov Jun 24 '16 at 09:42
0

You can add below code in your xml file.this custom form.phtml file display after coupon block.

 <adminhtml_sales_order_create_load_block_items>
              <reference name="items_grid">
                <block type="core/template" template="your_module/sales/order/create/form.phtml" name="your_module_admin_block" after="-" />
            </reference>
        </adminhtml_sales_order_create_load_block_items>
        <adminhtml_sales_order_create_index>
            <reference name="items_grid">
               <block type="core/template" template="your_module/sales/order/create/form.phtml" name="your_module_admin_block" after="-" />
            </reference>
        </adminhtml_sales_order_create_index>
        <adminhtml_sales_order_create_load_block_data>
             <reference name="items_grid">
              <block type="core/template" template="your_module/sales/order/create/form.phtml" name="your_module_admin_block" after="-" />
            </reference>
    </adminhtml_sales_order_create_load_block_data>
Niraj Patel
  • 65
  • 14