I am using the sales_order_grid_collection_load_before
event in order to append a filter to the collection.
However, in my case, I need to JOIN sales_flat_order
table.
The problem is that the ordering is of the form ORDER BY created_at
, and both sales_flat_order_grid
and sales_flat_order
have this column name..
How can I change/modify it to main_table.created_at
, for instance?
I'm looking for a systematic method to prepend the table aliases to ORDER
statements regardless of the specific column used, and, maybe to GROUP
statements to.
How can I achieve this?