I want to add coupon code in sales order grid . As we know Sales order gird build from sales_flat_order_grid table
Coupon_code column is exist in sales_flat_order
table not sales_flat_order_grid
table.
When i add coupon_code at sales order grid but when I search the coupon code with status column then got this error : Column 'status' in where clause is ambiguous
Note : I am working on existing project not new project
Magento version : 1.7.0.2
Can you please provide me solution
Best Answer
As Magento save
coupon code
on Sales_flat_Order table so you need to MySQL join withSales_flat_order
tableAdd sales_flat_order table to collection.In magento, sales_flat_order and sales_flat_order_grid table related with Flat Grid order table entity_id and
sales_flat_order table entity_id
.Rewrite class then add columns to show Coupon: