User defined field not updating with PHP code I am using the uc_node_checkout and I need to set some fields that I have created. The php code is this

if (isset($order)) {
  foreach ($order-&gt;products as $product) {
    if (isset($product-&gt;data['node_checkout_nid'])) {
      $node = node_load($product-&gt;data['node_checkout_nid']);
      $node-&gt;field_productid['0']['value'] = $order-&gt;order_id;
      node_save($node);
    }
  }
}


If I create an order and add this line to the end of the php code, it dies and show a number.
die($node->field_productid['0']['value']);
When I remove that line and place and order the productid is empty.
Change this:

&lt;?php
      $node-&gt;field_productid['0']['value'] = $order-&gt;order_id;
?&gt;


To this:

&lt;?php
      $node-&gt;field_productid[LANGUAGE_NONE][0]['value'] = $order-&gt;order_id;
?&gt;


See if that helps.