Afsal Afsal - 1 year ago 96
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

. The link to the main table ie

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());
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 Source

Here you can find nice tutorial for adding columns to order grid:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download