我想在销售订单创建页面上添加自定义块。
这是我的代码
<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>
它的工作正常,但如果我将参考从侧栏更改为内容或数据阻止它无效,我想添加此块在内容块中。 我不想改变data.phtml的核心文件。 我如何创建自己的data.phtml文件..
很多混淆。虽然所有可能的答案都与Magento add block to sales order create相关。请帮助
答案 0 :(得分:1)
您只需将output="toHtml"
添加到您的区块即可自动渲染此区块。
<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>
并且我认为你有自定义主题,因为content
块的类型为list
,并且他内部的所有块都必须自动渲染。
答案 1 :(得分:0)
您可以在优惠券屏幕后的xml
文件中添加以下代码。此自定义form.phtml
文件显示。
<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>