【问题标题】:Magento:Adding store credit to customers gridMagento:将商店信用添加到客户网格
【发布时间】:2013-08-07 10:21:03
【问题描述】:

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

我已编辑以下文件: 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'           
        ));
----------------------
}
----------------------

任何帮助表示赞赏,

谢谢。

【问题讨论】:

    标签: magento


    【解决方案1】:

    您尝试添加'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',
        ));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-28
      相关资源
      最近更新 更多