title: How to get Variation ID of Variable Product in WooCommerce?
body: <p>On single product page of variable product, when I change different variation from the dropdown, I want to show the price from another custom field instead of default variation price (which field I already created in Dashboard). But, I didn't find a way to show the price on product page.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>add_filter('woocommerce_product_variation_get_regular_price', 'custom_price', 99, 2 );
  add_filter('woocommerce_product_variation_get_price', 'custom_price', 99, 2 );
  
  function custom_price( $price, $product )
  {
      return $price;
  }
  </code></pre>
  
  <p>Inside the function <code>custom_price</code>, if I get the variation id, I could do something like this:</p>
  
  <pre><code>function custom_price( $price, $product )
  {
      $variation_id = ???
      return get_post_meta( $variation_id, 'custom_field', true );
  }
  </code></pre>
  
  <p>How can I get variation id inside this function? Thanks in advance.</p>