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

Add Company field to order grid
 
jessehen
Jr. Member
 
Total Posts:  2
Joined:  2009-11-12
 

I want to add a company field in de order grid view in the admin panel. But i cant get it working..

I tried to add in app/code/local/Mage/Adminhtml/Block/Sales/Grid.php

$collection->join('company''order_address/company''billing_address_id'null'left');

AND

$this->addColumn('company', array(
            
'header' => Mage::helper('sales')->__('Billing company'),
            
'index' => 'company',
        ));

Now i get the error: “Can’t retrieve entity config: sales/company”

Can someone help me ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
kiatng
Enthusiast
 
Total Posts:  875
Joined:  2008-09-03
Kuala Lumpur, Malaysia
 

I wonder if this works:

$collection->getSelect()->joinLeft(
                array(
'address' => $this->getTable('sales/order_address')), 'order'=> $this->getTable('sales/order'))
                
'main_table.increment_id=order.increment_id' AND 'order.entity_id=address.parent_id',
                array(
'company'=>'address.company')
            );
        return 
$this;
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top