1

I want to show all the record of the customer who have multiple order in one row as per customer entered email in my order grid, any who have tried this earlier please suggest me the way.

  • Do you mean you want to filter by email? – kiatng Apr 28 '17 at 9:49
  • yes and that be filterable with given date in grid filter – Bibhu Asish Apr 28 '17 at 9:57
  • You need to add new column in sales_flat_order_grid with the customer_email column from sales_flat_order and add index on it. Then you can simply overwrite Mage_Adminhtml_Block_Sales_Order_Grid and render the new column. – kiatng Apr 28 '17 at 10:21
0

ok it was simple I just need to join table the code for creating the collection in grid i have given below

$collection->getSelect()->join('sales_flat_order', 'main_table.entity_id = sales_flat_order.entity_id', array('customer_email' => 'customer_email', 'orders_count' => 'COUNT(sales_flat_order.entity_id)'))->group('sales_flat_order.customer_email');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.