title: Add custom checkout field as Order custom-meta data in Woocommerce 3
body: <p>before <strong>WooCommerce 3.0</strong> came out my code had worked like a charm to save custom values from the cart into the order on checkout. But since then I'm not able to create custom meta for orders.</p>
  
  <p><strong>Environment:</strong> Wordpress 4.9.4 &amp; WooCommerce 3.3.3</p>
  
  <h2>Hooks</h2>
  
  <ol>
  <li><code>add_action('woocommerce_checkout_update_order_meta', 'custom_meta_to_order', 20, 1);</code></li>
  <li><code>add_action('woocommerce_checkout_create_order', 'custom_meta_to_order', 20, 1);</code></li>
  </ol>
  
  <p>The Hook number 1 is the one I tried the most, the 2 one was just an experiment with some literal <a href="https://stackoverflow.com/a/48502896/1712681">changes mentioned in this topic</a>.</p>
  
  <h2>Function</h2>
  
  <p><em>The following functions-code is related to hook number 1</em>:</p>
  
  <pre><code>if (!function_exists('custom_meta_to_order')) {
      function custom_meta_to_order($order_id, $values) {
          $order = wc_get_order( $order_id );
  
          $order-&gt;update_meta_data('_TESTKEYstart', 'Hello');
  
          if (isset($values['myValue'])) {
              $myValue = $values['myValue'];
              if (!empty($myValue)) $order-&gt;update_meta_data('_myKey', $myValue);
          }
  
          $order-&gt;update_meta_data('_TESTKEYend', 'Bye');
  
          $order-&gt;save();
      }
  }
  </code></pre>
  
  <p>I've checked also in the mySQL table <code>table wp_woocommerce_order_itemmeta</code> if at least the two <strong>_TESTKEY*</strong>-meta-entrys will be created (because they don't have a condition).</p>
  
  <ul>
  <li>But it seems that the meta-keys and values don't getting created via this hook and function.</li>
  <li>The function itself getting called, so at least the hooks itselfs are working.</li>
  </ul>
  
  <h2>So my question is: "What am I doing wrong?"</h2>