title: Set the product type when creating a product programmatically in Woocommerce 3
body: <p>In Woocommerce, I am trying to find a way similar to the <code>WC_Product</code> methods <code>set_name()</code> or <code>set_status()</code> for example, to set the product type like <strong>Simple</strong> or <strong>Variation</strong>.</p>
  
  <p>Actually I use the <code>WC_Product</code> object like this :</p>
  
  <pre><code>    $product = new WC_Product;
  
      $product-&gt;set_name($data['product']['title']);
  
      $product-&gt;set_status('pending');
  
      $product-&gt;save();
  </code></pre>
  
  <p>How can I <strong>set the product type</strong> if user check "simple product" or "variable product"?</p>
  
  <p>Any help is appreciated.</p>