title: Add a custom checkout multi-select field and update order meta in Woocommerce
body: <p>I'm struggling with one custom woocommerce checkout form's <strong>multi-select field</strong>.</p>
  
  <p>I created custom multislect field via function:</p>
  
  <pre><code>add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
  
  function custom_override_checkout_fields( $fields ) { 
       $fields['billing']['_myfield'] = array(
          'type'      =&gt; 'select',
          'id' =&gt; '_myfield',
          'label'     =&gt; __('My Field', 'woocommerce'),
          'required'  =&gt; true,
          'class'     =&gt; array('form-row-wide'),
          'clear'     =&gt; true,
          'options'       =&gt; [
              'key1'  =&gt; __('First Item', 'woocommerce'),
              'key2'  =&gt; __('Second Item', 'woocommerce'),
              'key3'  =&gt; __('Third Item', 'woocommerce'),
              'key4'  =&gt; __('Fourth Item', 'woocommerce')
          ]
      );
      return $fields;
  }
  </code></pre>
  
  <p>note, that woocommerce function <code>custom_override_checkout_fields</code> isn't capable to create a custom multi-select field, so here we have simple select field.</p>
  
  <p>I decided to use <strong>jQuery</strong> to add the multiple missing attribute this way:</p>
  
  <pre><code>$('#_myfield').attr('multiple', 'multiple');
  </code></pre>
  
  <p>So now I have multiselect field, which looks like:</p>
  
  <pre><code>&lt;select name="_myfield" id="_myfield" class="select " data-placeholder="" multiple="multiple"&gt;...&lt;/select&gt;
  </code></pre>
  
  <p><strong>Problem is</strong>, that order meta value isn't updating properly, it show everytime only one value, not an array of values if person select more than one option.</p>
  
  <p>I'm using this function to update order's meta value:</p>
  
  <pre><code>add_action('woocommerce_checkout_update_order_meta', 'my_custom_checkout_field_update_order_meta');
  
  function my_custom_checkout_field_update_order_meta($order_id) {
     update_post_meta($order_id, '_myfield', $_POST['_myfield'] );
  }
  </code></pre>
  
  <p>Any help ? </p>
  
  <p>Maybe there's is better solution to create multi-select field in checkout's billing section?</p>