title: woocommerce in wordpress return always simple as product type
body: <p>I try of get the type of a grouped product but woocommerce returns empty or always "simple" if I use WC_Product_Factory.</p>
  
  <p>When I use:</p>
  
  <pre><code>$the_product = new WC_Product(2886);
  echo $the_product-&gt;product_type;
  </code></pre>
  
  <p>returns empty.</p>
  
  <p>When I use WC_Product_Factory:</p>
  
  <pre><code>$the_product = new WC_Product(2886);
  $the_product_factory = new WC_Product_Factory();
  $the_product = $the_product_factory-&gt;get_product($the_product);
  echo $the_product-&gt;product_type;
  </code></pre>
  
  <p>always returns "simple"</p>
  
  <p>I try to use:</p>
  
  <pre><code>$the_product = wc_get_product(2886);
  echo $the_product-&gt;product_type;
  </code></pre>
  
  <p>but this returns an error "Call to a member function get_product() on a non-object in..."</p>
  
  <p>My code is inside of:</p>
  
  <pre><code>add_action( 'plugins_loaded', function(){
      $the_product = new WC_Product(2886);
      echo $the_product-&gt;product_type;
  
      $the_product = new WC_Product(2886);
      $the_product_factory = new WC_Product_Factory();
      $the_product = $the_product_factory-&gt;get_product($the_product);
      echo $the_product-&gt;product_type;
  
      $the_product = wc_get_product(2886);
      echo $the_product-&gt;product_type;
  
      die();
  });
  </code></pre>
  
  <p>Well, Thanks for your help!</p>