Magento将块添加到销售订单创建 [英] Magento add block to sales order create

查看:118
本文介绍了Magento将块添加到销售订单创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试向管理员创建订单屏幕添加一个块.我的布局xml我有

    <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>

该块根本不会显示数据"甚至内容"的引用,如果我更改引用以说左",则它会显示,但我确实需要在运输方法下的数据区域中使用它.内容参考没有模板文件,因此我看不到需要回显子块.不知道我在做什么错.任何指针,将不胜感激.

解决方案

data块不会匿名显示其所有子级,您可以检查其模板文件(app/design/adminhtml/default/default/template/sales/order/create/data.phtml)以查看其实际工作方式.

要在运输方式下显示您自己的块,您将需要基于原始模板将自己的模板应用于data块,并在希望显示它的位置添加相应的getChildHtml调用

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.

解决方案

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.

这篇关于Magento将块添加到销售订单创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆