Magento Database – Relationship Between customer_entity Table and Sales

customerdatabasesales

I'm trying to merge Magento orders between two different stores and I'm tracking down all of the relationships. The one I'm currently trying to figure out is the customer_entity table and the sales_* tables. I don't see a foreign key or entity_id that would line the two up.

How does Magento associate customer tables with sales?

Best Answer

See sales_flat_order.customer_id

Since customer can check out as guest, then customer_id is either null for quest or contain the customer id for register member

Related Topic