Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Adding store credit to customers grid
 
iqbalmp
Jr. Member
 
Total Posts:  15
Joined:  2010-11-11
 

Hello,

I have tried to add customer balance (store credit) column to the customer grid in Magento admin panel. It works fine, but when I tried to search by customer balance by enterinng ‘From:’ and ‘To:’ values, it throws an error “PHP Fatal error:  Call to a member function getBackend() on a non-object in …./app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 816"”
I have edit the below file:
app/code/core/Mage/Adminhtml/Block/Customer/Grid.php

{
$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'           
        
));
----------------------
}
----------------------
Any help appreciated,

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top