0

Magento 管理パネルの顧客グリッドに顧客残高 (ストア クレジット) 列を追加しようとしました。正常に動作しますが、'From:' と 'To:' の値を入力して顧客残高で検索しようとすると、エラー「PHP Fatal error: Call to a member function getBackend() on a non-object in … ./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 に答える