Afsal Afsal - 26 days ago 13
PHP Question

Magento sales order grid customization

I want to customize magento order grid. I need to add one more column which is in the table

sales_flat_order_address
. The link to the main table ie
sales_flat_order_grid
is
parent_id
.

Need to join such a way that
sales_flat_order_address.entity_id = sales_flat_order_grid.parent_id
.

But when I try for this i am getting an error "Integrity constraint violation: 1052 Column 'entity_id' in group statement is ambiguous".

$collection = Mage::getResourceModel($this->_getCollectionClass());
$collection->getSelect()
joinLeft(array('table_alias2'=>$collection->getTable('deliveryinfo/saleslocation')),'main_table.entity_id = table_alias2.parent_id',array('table_alias2.entity_id'));


any help would be highly appreciated.

Answer

Here you can find nice tutorial for adding columns to order grid: http://www.ecomdev.org/2010/07/27/adding-order-attribute-to-orders-grid-in-magento-1-4-1.html

Comments