Where does magento store the data which is shown in the block Account information
in adminarea
in order edit page
?
2 Answers
in the sales_flat_order
table as the rest of the order details.
A field values shows under the Account Information
tab if the field name from the table starts with customer_
. You can see this in Mage_Adminhtml_Block_Sales_Order_View_Info::getCustomerAccountData
-
Yes, in described model I saw this method. I see that all data is taken from order, but these data is already in order. When it appear there? And I can't find any my account info in
sales_flat_order
. Maybe I have customized magento... Commented Mar 2, 2016 at 15:22 -
In addition. I have custom customer attribute (its magento EE). I changed this attr on order creation page in admin area. This attribute wasn't changed in customer account. Also I created SQL dump and did search for my value_id and didn't find it there. Commented Mar 2, 2016 at 15:31
Found..
These values are here: enterprise_customer_sales_flat_order
On order afterLoad execute following:
Enterprise_Customer_Model_Observer
/**
* After load observer for order
*
* @param Varien_Event_Observer $observer
* @return Enterprise_Customer_Model_Observer
*/
public function salesOrderAfterLoad(Varien_Event_Observer $observer)
{
$order = $observer->getEvent()->getOrder();
if ($order instanceof Mage_Core_Model_Abstract) {
Mage::getModel('enterprise_customer/sales_order')
->load($order->getId())
->attachAttributeData($order);
}
return $this;
}