How can I update a custom Order field in a plugin controller? I have a custom plugin in which I have a controller action which I want to validate some values and then update a custom field on the Cart.

I can get the values from the form and validate them, I'm just missing how to get them saved to the Cart. 

I've tried the following:

$this-&gt;cart-&gt;setRawPostContent('orderShippingOptions', $myValue);
$this-&gt;cart-&gt;setContentFromPost('fields');


And also just:

$this-&gt;cart-&gt;setContentFromPost(['orderShippingOptions' =&gt; $myValue]);


I'm feel like I'm in the right area, I'm just missing something simple.

Any help gratefully received.
Turns out I really overthought this one! It's exactly the same as you would usually do it in Craft.

$this-&gt;cart-&gt;getContent()-&gt;setAttributes(array(
    'orderShippingOptions' =&gt; $myValue
));

craft()-&gt;commerce_orders-&gt;saveOrder($this-&gt;cart);


The bit I was missing was craft()-&gt;commerce_orders-&gt;saveOrder($this-&gt;cart);