title: Extending WC_Product class in a custom plugin error issue (WC_Product class not found)
body: <p>I'm trying to extend the WC_Product class to add "property1" and "property2" to the protected array $data but when I try to run my plugin it give me the next error: </p>
  
  <blockquote>
    <p>WC_Product not found.</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>class WC_MyClass extends WC_Product {
      function __construct() {
          parent::__construct();
          array_push($data, "property1", "property2");
      }
  }
  </code></pre>
  
  <p>What I need is to extend WC_Product class in my plugin.</p>
  
  <p>Plugin details:
  My plugin consist in calculate shipping costs according FedEx table rate for my country.
  To do this I'm using the Woocommerce Table Rate Shipping plugin. The problem is that FedEx sometimes takes into acount not the real weight but volumetric so I want to do a plugin to determinate which weight is greater and assign it to a variable. The idea is to set a shipping weight to use it to calculate shipping cost and not to modify the product weight specification. This is why I'm trying to extend the WC_Product class to add to it the shipping weight property. I have already done all calculus, now I just need to store the shipping weight to use it with the Woocommerce Table Rate Shipping plugin.</p>
  
  <p>Documentation: <a href="https://docs.woocommerce.com/wc-apidocs/source-class-WC_Product.html#42-96" rel="nofollow noreferrer">WC_Product class - $data property</a></p>