title: Get value new custom field in variations product Woocommerce?
body: <p>Good day! I created new custom filed in variations product Woocommerce! How do get value this field for use him in other function?</p>
  
  <p>In General I need to pass a value from one function to another is it possible to do this at all ?</p>
  
  <pre><code>add_action( 'woocommerce_product_after_variable_attributes', 'num_cubicmeters_fields', 10, 3 );
  function num_cubicmeters_fields( $loop, $variation_data, $variation ) {
      woocommerce_wp_text_input( array(
          'id'                =&gt; '_num_cubic_var[' . $variation-&gt;ID . ']', // id поля
          'label'             =&gt; 'Количество кубометров', // Надпись над полем
          'description'       =&gt; 'Укажи количество кубометров',// Описание поля
          'desc_tip'          =&gt; 'true', // Всплывающая подсказка
          'placeholder'       =&gt; 'Количество кубометров, м3', // Надпись внутри поля
          'type'              =&gt; 'number', // Тип поля
          'custom_attributes' =&gt; array( // Произвольные аттрибуты
              'step' =&gt; 'any', // Шаг значений
              'min'  =&gt; '0', // Минимальное значение
          ),
          'value'             =&gt; get_post_meta( $variation-&gt;ID, '_num_cubic_var', true ),
      ) );
  }
  
  
  add_action( 'woocommerce_save_product_variation', 'art_save_variation_settings_fields', 10, 2 );
  function art_save_variation_settings_fields( $post_id ) {
      $woocommerce__num_cubic_var = $_POST['_num_cubic_var'][ $post_id ];
      if (isset($woocommerce__num_cubic_var) &amp;&amp; ! empty( $woocommerce__num_cubic_var ) ) {
          update_post_meta( $post_id, '_num_cubic_var', esc_attr( $woocommerce__num_cubic_var ) );
      }
  }
  
  add_filter( 'woocommerce_available_variation', 'load_variation_settings_fields' );
  function load_variation_settings_fields( $variations ) {
      $variations_num_cubic = get_post_meta( $variations['variation_id'], '_num_cubic_var', true );
      if ( isset( $variations_num_cubic ) &amp;&amp; ! empty( $variations_num_cubic ) ) {
          $variations['_num_cubic_var'] = '&lt;div class="num-cubicmeters-prod"&gt;';
          $variations['_num_cubic_var'] .= '&lt;span&gt;Количество Кубометров&lt;/span&gt;';
          $variations['_num_cubic_var'] .= get_post_meta( $variations['variation_id'], '_num_cubic_var', true ) . ' м3';
          $variations['_num_cubic_var'] .= '&lt;/div&gt;';
      }
  
      return $variations;
  }
  
  
  
  function ut_before_calculate_totals( $cart_obj ) {
  
  ////    global $product;
  ////    echo '&lt;pre&gt;';
  ////        var_dump($product);
  ////    echo '&lt;/pre&gt;';
  //
  //    $meta = get_post_meta();
  //    var_dump($meta);
  
  
  //    $variations_num_cubic = get_post_meta( $variations['variation_id'], '_num_cubic_var', true );
  //    var_dump($variations_num_cubic);
  
  
  
      foreach( $cart_obj-&gt;get_cart() as $key =&gt; $value ) {
  
          $product_total_price = ( !empty( get_post_meta( $value['data']-&gt;get_id(), '_sale_price', true) ) ) ? get_post_meta( $value['data']-&gt;get_id(), '_sale_price', true) : get_post_meta( $value['data']-&gt;get_id(), '_regular_price', true);
          $volume = ( isset( $value['variation']['attribute_m-3-na-poddone'] ) ) ? $value['variation']['attribute_m-3-na-poddone'] : 1 ;
          $result_price = $product_total_price * $volume ;
  
          $value['data']-&gt;set_price( $result_price );
  
      }
  }
  </code></pre>
  
  <p><a href="http://pastebin.com/vaAaaZiG" rel="nofollow noreferrer">function create field</a></p>
  
  <p><a href="http://pastebin.com/ca6avSX8" rel="nofollow noreferrer">dunction for use field</a></p>