How to store form in order I have customers filling out an entry form before sending them to checkout.  Is it possible to store, or serialize, the $form_state array in the order?  There is a 'data' field in the order.  Is it simple as me calling:

$order-&gt;data = serialize($form_state);
commerce_order_save($order);


EDIT:

The data field in the order is an array that gets serialized.  So, it looks like I can do:

$order-&gt;data['myform'] = $form_state;
There is the data attribute on entities, which you cannot access through Entity Metadata Wrappers (per previous answer.)

Do you need the full form state or just values? Also, you do not need to serialize the data, as the entity controller will do this for you.

I would do something like:

form_state_values_clean($form_state);
$order-&gt;data['myform_values'] = $form_state['values'];


form_state_values_clean() will remove build IDs and such.