title: Unable to get product weight in WooCommerce
body: <p>I am trying to get product weight in my plugin to show it on sidebar in separate input box. But I am unable to get the product weight. </p>
  
  <p>Please take a look at my code and help me to get the product weight from WooCommerce product: </p>
  
  <pre><code>&lt;?php
  /**
   * Plugin Name: Calculator
   * Plugin URI: http://wordpress.org/
   * Description: Calculate
   * Version: 1.0.0
   * Author: wtm
   * Author URI: http://wtynet.com
   */
  
  if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  
  if ( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) return; // Check if WooCommerce is active
  
  add_action( 'woocommerce_product_meta_end', 'showtest', 10 );
  function showtest(){
  
  $prweight = WC_Product::get_weight();
  echo "&lt;div style='border: 2px solid #43515f; padding: 10px; text-align:center;'&gt;";
  
  your_css_and_js();
  echo "&lt;input id= 'prweight' type='text' value='".$prweight."'&gt;";
  
  echo "&lt;/div&gt;";
  
  }
  
  function your_css_and_js() {
  wp_register_style('your_css_and_js', plugins_url('css/style.css',__FILE__ ));
  wp_enqueue_style('your_css_and_js');
  wp_register_script( 'your_css_and_js', plugins_url('js/script.js',__FILE__ ));
  wp_enqueue_script('your_css_and_js');
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>Thanks.</p>