title: Get the count of "in stock" product variations for a variable product in Woocommerce
body: <p>I'm trying to make a snippet for functions.php file that shows only one price of selected variation, thus omitting the price range displayed along with variation price on single product page. I'm using the following code: </p>
  
  <pre><code>    add_action( 'woocommerce_before_single_product', 'my_remove_variation_price' );
  $product_variations=$product_variable-&gt;get_available_variations;
  function my_remove_variation_price() {
    global $product;
    if ( $product-&gt;is_type( 'variable' ) {
      remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price' );
    }
  }
  </code></pre>
  
  <p>The problem is when you have, for instance, two variations of single product and one goes out of stock, this script hides the price of one remaining variation on single product page.
  I was thinking maybe to have a COUNT of available variations per product and use IF to show them using standard single product template. Or maybe you have better idea how to solve that?</p>