我如何在销售订单视图的左侧添加新标签,例如现在magento中的发票贷项凭证,下达等 [英] How can i add a new tab in left in sales order view,like now are invoices credit memos,releases etc in magento

查看:53
本文介绍了我如何在销售订单视图的左侧添加新标签,例如现在magento中的发票贷项凭证,下达等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在sales-> order-> view的左侧添加一个新选项卡.为此,我创建了一个模块但未解决我的问题,它显示了错误的选项卡配置之类的错误,我在许多链接上进行了搜索也张贴在堆栈溢出中,但还不满意. 谢谢

i want to add a new tab in left in sales->order->view.For this i have created a module but not solved my problem,it is showing an error like wrong tab configuration,i have search on many links also posted in stack overflow,but not yet satisfied. Thanks

推荐答案

这实际上应该很容易做到.只需查看app/design/adminhtml/default/default/layout/sales.xml布局文件.您可以在其中找到<adminhtml_sales_order_view>节点,该节点定义了订单视图页面上使用的所有块.

This actually should be quite easy to do. Just look at the app/design/adminhtml/default/default/layout/sales.xml layout file. You can find there the <adminhtml_sales_order_view> node, which defines all blocks used on order's view page.

为了添加新的选项卡,您需要在文件中放置另一个>声明.当前,选项卡的定义是这样的(Magento EE 1.11):

In order to add a new tab, you would need to put another <action> declaration in the file. Currently tabs are defined like this (Magento EE 1.11):


<adminhtml_sales_order_view>
    (...)
    <reference name="left">
        <block type="adminhtml/sales_order_view_tabs" name="sales_order_tabs">
            <action method="addTab"><name>order_info</name><block>order_tab_info</block></action>
            <action method="addTab"><name>order_invoices</name><block>adminhtml/sales_order_view_tab_invoices</block></action>
            <action method="addTab"><name>order_creditmemos</name><block>adminhtml/sales_order_view_tab_creditmemos</block></action>
            <action method="addTab"><name>order_shipments</name><block>adminhtml/sales_order_view_tab_shipments</block></action>
            <action method="addTab"><name>order_history</name><block>adminhtml/sales_order_view_tab_history</block></action>
            <action method="addTab"><name>order_transactions</name><block>adminhtml/sales_order_view_tab_transactions</block></action>
        </block>
    </reference>
</adminhtml_sales_order_view>

请注意,请勿更改核心模板!

在这种情况下,您应该在 local 代码池中创建新模块或更改现有模块.在config.xml中定义布局更新,然后以adminhtml默认主题创建新的布局文件,例如:

In this case you should create new module or alter existing one in local code pool. Define a layout updates in config.xml and then create new layout file in adminhtml default theme, for example:

app/design/adminhtml/default/default/layout/CUSTOM_VENDOR/sales.xml:


<adminhtml_sales_order_view>
    <reference name="sales_order_tabs">
        <action method="addTab"><name>TAB_NAME</name><block>CUSTOM_BLOCK</block></action>         
    </reference>
</adminhtml_sales_order_view>

然后,您只需要创建新的块和模板即可.

Then you just need to create new block and a template.

这篇关于我如何在销售订单视图的左侧添加新标签,例如现在magento中的发票贷项凭证,下达等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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