5

In magento we are updating orders in two tables each time, what is the real significance to use two tables,

what is the difference between sales_flat_order_grid and sales_flat_order tables ,

why we need to store order details in two tables.

10

sales_flat_order_grid works like an index to make displaying, sorting and filtering in the order grid faster and not blocking the real order tables. The source of truth for the shop is sales_flat_order.

The grid table is generated from it (see: Mage_Sales_Model_Resource_Order_Abstract::updateGridRecords().

  • is sales_flat_order_grid table has magento model – manokarthick karthick Jan 25 '17 at 12:59
  • @manokarthickkarthick No, only a collection class Mage_Sales_Model_Resource_Order_Grid_Collection, the items are regular order models – Fabian Schmengler Jan 25 '17 at 13:02
  • then how can i update the sales_flat_order_grid ? – manokarthick karthick Jan 25 '17 at 13:15
  • is collection model allow to update the table? – manokarthick karthick Jan 25 '17 at 13:15
  • Update with updateGridRecords(), see link above – Fabian Schmengler Jan 25 '17 at 13:19
2

sales_flat_order_grid table is for the Admin Order grid. In grid magento is showing billing name and shipping name, here shipping name and billing name are stored in another table.

To achieve this we have to join many tables, So they are using two different table.

sales_flat_order_grid is for Admin sales grid

And another one(sales_flat_order) is to store order details

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.