title: Woocommerce programatically convert cart into order
body: <p>I'm sure there must be a simple way to programatically create a new order from the current checkout data in WooCommerce but I can't find it anywhere.</p>
  
  <p>I have 
      $order = wc_create_order();
      $order->update_status('pending', 'order_note');</p>
  
  <p>but I need all products and shipping etc added to the order exactly as it would be if the order was processed. I really just need whatever is on the checkout page processed into an order.</p>
  
  <p>Surely this is a simple command?</p>
  
  <p>Thanks</p>
  
  <p>EDIT:</p>
  
  <p>So I now have added all billing and shipping address details in with a long, laborious process. But now I need the shipping data......</p>
  
  <pre><code>$shipping_total = WC()-&gt;cart-&gt;get_shipping_total();
  $order-&gt;set_shipping_total( $shipping_total );
  </code></pre>
  
  <p>The first line gets the amount but the second line doesn't seem to do anything. I think that I need to add in an entire shipping method to have the order list properly with full shipping info?</p>
  
  <p>Why isn't there a 'Make order from checkout' function?</p>
  
  <p>Thanks</p>