I created a custom column in sales/order grid named Product name, They are coming fine on first time, When I am doing sorting Found :
Column not found: 1054 Unknown column 'product_name' in 'order clause'
And find there is need to join ordered items also, Here is my code:
$joinTable2 =$this->getTable('customer_entity_varchar'); $this->getSelect()->join($joinTable2. ' as fn', 'main_table.customer_id = fn.entity_id and fn.attribute_id = 177',array('value')); return $this;
Please suggest if anyone have solution, Thanks in advance.