Can someone please tell me when a record is pushed into the "sales_flat_order_grid" table?
How can I switch first name and last name in "billing_name" column of this table?
Can someone please tell me when a record is pushed into the "sales_flat_order_grid" table?
How can I switch first name and last name in "billing_name" column of this table?
I think you want to customer_firstname
and customer_lastname
different column in sales_flat_order_grid
,,,,for that just create two column in sales_flat_order_grid
and clear your magento cache..
and try to place new order and see database you can see both column are poupluate with this value because resource model
detects the same name of columns
in grid
and main table
and fulfill it automatically,
Not clear with your requirement. sales_flat_order_grid table will be filled when order is created.Both sales_flat_order_grid and sales_flat_order will have same information.Do not directly edit in sales_flat_order_grid as this may change in the Grid but not in the order view page.I would suggest to listen an observer and write you logic. You can find evens in here https://www.nicksays.co.uk/magento-events-cheat-sheet-1-7/ Let me know if that helps
The name column of the grid table is populated by Mage_Sales_Model_Resource_Order::_initVirtualGridColumns()
.
You can rewrite this method to manipulate the format as I decribed here: Magento 1.9.2.0: table "sales_flat_order_grid" contains extra space in customer's name value (just switch $ifNullFirst and $ifNullLast to exchange their position)