在Magento Admin的销售订单视图项中添加新列 [英] Adding new column in Sales Order View Items in Magento Admin

查看:70
本文介绍了在Magento Admin的销售订单视图项中添加新列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Magento的管理界面中,我需要修改销售/订单/查看"订单中的表格,以便除了产品名称之外,还显示其制造商.

我正在尝试查找文件以进行修改.我以为我会找到一个包含所有在app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php中显示的列的部分,但是通过检查它似乎没有对这些列的引用/产品属性.<​​/p>

我也试图修改 app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml 通过更改

<?php echo $this->getColumnHtml($_item, 'name') ?>

进入

<?php echo $this->getColumnHtml($_item, 'manufacturer') ?>

但是它什么都没改变,所以我想这个文件没有涉及...

有人可以指出正确的文件进行修改吗?

谢谢!

解决方案

在浏览了很多代码并在同事的帮助下,我们发现两个文件都需要更改,以在此视图中添加列:

  • app/design/adminhtml/default/default/template/sales/order/view/items.phtml 用于添加表头

  • app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml用于用数据填充列.

我对Magento并没有真正的经验,但是我想为了做一个干净的工作",人们不应该直接修改这些文件,而应该覆盖它们.

编辑

  • app/design/adminhtml/default/default/template/downloadable/sales/order/view/items/renderer/downloadable.phtml用于用可下载产品的数据填充列.

In the admin interface of Magento I need to modify the tables in the Sales / Order / View order so that it shows, besides the products name, their manufacturer as well.

I'm trying to look for the file to modify to make that happen. I thought I would find a section with all the columns that are displayed in app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php but by inspecting it there seem to be no reference to the columns/product attributes.

I also tried to modify app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml by changing

<?php echo $this->getColumnHtml($_item, 'name') ?>

into

<?php echo $this->getColumnHtml($_item, 'manufacturer') ?>

but it changed nothing, so I suppose that file is not involved...

Can anybody please point me to the right file to modify?

Thank you!

解决方案

After quite a lot of browsing through the code and with some help from a collegue, we found out the two file to change for adding a column to such view:

  • app/design/adminhtml/default/default/template/sales/order/view/items.phtml for adding the table header

  • app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml for filling the column with data.

I'm not really experienced with Magento but I guess that, in order to do a "clean job", one should not directly modify those files but override them instead.

EDIT

  • app/design/adminhtml/default/default/template/downloadable/sales/order/view/items/renderer/downloadable.phtml for filling the column with data for downloadable products.

这篇关于在Magento Admin的销售订单视图项中添加新列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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