title: WooCommerce costum meta_key
body: <p>I would like to add a custom <code>meta_key</code> value to each WooCommerce product It will be the Discount rate :</p>
  
  <pre><code>_discount_rate = ((_sale_price-_regular_price_)/(_regular_price)*100)
  </code></pre>
  
  <p>I'm trying to figure out how to add a filter to WooCommerce function <code>woocommerce_process_product_meta</code> Something like:</p>
  
  <pre><code>add_filter('woocommerce_process_product_meta', 'mytheme_product_save_discountrate');
  
  function mytheme_product_save_discountrate($post_id) {
  
      if (get_post_meta($post_id, "_sale_price")) {
  
          $regular_price = get_post_meta($post_id, "_regular_price");
          $sale_price = get_post_meta($post_id, "_sale_price");
  
          $discount_rate = ($sale_price - $regular_price) / $regular_price * 100);
  
          update_post_meta($post_id, '_discount_rate', $discount_rate);
      }
  }
  </code></pre>
  
  <p>I'm just not sure how I can retrieve the regular and sale prices?</p>