Chinaunix首页 | 论坛 | 博客
  • 博客访问: 269107
  • 博文数量: 59
  • 博客积分: 1368
  • 博客等级: 中尉
  • 技术积分: 1071
  • 用 户 组: 普通用户
  • 注册时间: 2012-02-02 06:06
文章分类

全部博文(59)

文章存档

2012年(59)

我的朋友

分类: 系统运维

2012-03-04 02:02:29

Magento后台的Order表格中默认并不显示订单的支付方式,如果需要添加支付方式,修改/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php

1 在_prepareCollection()函数的
  1. $collection = Mage::getResourceModel($this->_getCollectionClass());
下面添加
  1. $collection->join('sales/order_payment', 'main_table.entity_id=parent_id', array('method' => 'method'), null, 'left');

2 在_prepareColumns()函数的
  1. $this->addColumn('status', array(
  2.     'header' => Mage::helper('sales')->__('Status'),
  3.     'index' => 'status',
  4.     'type' => 'options',
  5.     'width' => '70px',
  6.     'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
  7. ));
下面添加
  1. $this->addColumn('method', array(
  2.     'header' => Mage::helper('sales')->__('Payment Method'),
  3.     'index' => 'method',
  4.     'width' => '100px',
  5. ));
刷新后台,就可以看到支付方法出现在订单的表格中了,同样可以对支付方法进行过滤和排序。

阅读(2928) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~