0

我试图将客户余额(商店信用)列添加到 Magento 管理面板的客户网格中。它工作正常,但是当我尝试通过输入'From:'和'To:'值来按客户余额进行搜索时,它会引发错误“PHP 致命错误:在...中的非对象上调用成员函数 getBackend() ./app/code/core/Mage/Eav/Model/Entity/Abstract.php 第 816 行"”</p>

我已经编辑了以下文件:app/code/core/Mage/Adminhtml/Block/Customer/Grid.php

     protected function _prepareCollection()
  {
$collection = -----------
------------------------
 $collection->getSelect()->joinLeft( array('balance_table'=>'enterprise_customerbalance'),
              'e.entity_id = balance_table.customer_id', array('balance_table.*'));
           $collection->addAttributeToSelect('amount');           
        $this->setCollection($collection);
        return parent::_prepareCollection();
}
---------------------
---------------------
protected function _prepareColumns()
    {
----------------------
 $this->addColumn('amount', array(
            'header'    => Mage::helper('customer')->__('Store Credit'),
            'index'     => 'amount',
            'type'      => 'currency',
            'currency' => 'base_currency_code'           
        ));
----------------------
}
----------------------

任何帮助表示赞赏,

谢谢。

4

1 回答 1

0

您是否尝试添加'filter_index' => 'balance_table.amount',

    $this->addColumn('amount', array(
        'header'    => Mage::helper('customer')->__('Store Credit'),
        'align'     =>'right',
        'width'     => '20px',
        'index'     => 'amount',
        'filter_index' => 'balance_table. amount',
    ));
于 2013-08-06T16:46:39.850 回答