title: Change product variation prices via a hook in WooCommerce 3.3
body: <p>I´m using hooks for customizing variable product prices.</p>
  
  <p>However, <a href="https://stackoverflow.com/questions/45806249/change-product-prices-via-a-hook-in-woocommerce-3/45807054#45807054">this answer</a> does not seem to be working for Woocommerce 3.3.5.</p>
  
  <p>I use following (from the previous post) on my <code>functions.php</code> file:</p>
  
  <pre class="lang-php prettyprint-override"><code>add_filter('woocommerce_variation_prices_price', 'custom_variation_price', 99, 3 );
  add_filter('woocommerce_variation_prices_regular_price', 'custom_variation_price', 99, 3 );
  function custom_variation_price( $price, $variation, $product ) {
      // Delete product cached price  (if needed)
  wc_delete_product_transients($variation-&gt;get_id());
  
  return $price * 3; // X2 for testing
  }
  </code></pre>
  
  <p>On product page the price range for product variations shows correct prices (original price*3) but when I select options, price shown for variation is unfiltered. Am I missing something here?</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> I had a slightly different price calculation for simple products and for product variations. I ended up with 3 functions:</p>
  
  <pre class="lang-php prettyprint-override"><code>// Simple
  add_filter('woocommerce_product_get_price', 'custom_price', 99, 2 );
  add_filter('woocommerce_product_get_regular_price', 'custom_price', 99, 2 );
  
  // Variable
  add_filter('woocommerce_product_variation_get_regular_price', 'custom_price_2', 99, 2 );
  add_filter('woocommerce_product_variation_get_price', 'custom_price_2' , 99, 2 );
  
  // Variations (of a variable product)
  add_filter('woocommerce_variation_prices_price', 'custom_variation_price', 99, 3 );
  add_filter('woocommerce_variation_prices_regular_price', 'custom_variation_price', 99, 3 );
  
  function custom_price( $price, $product ) {
      // Delete product cached price  (if needed)
      wc_delete_product_transients($product-&gt;get_id());
  
      return $price * 3; // X3 for testing
  }
  
  function custom_price_2( $price, $product ) {
      // Delete product cached price  (if needed)
      wc_delete_product_transients($product-&gt;get_id());
  
      return $price * 2; // X2 for testing
  }
  
  function custom_variation_price( $price, $variation, $product ) {
      // Delete product cached price  (if needed)
      wc_delete_product_transients($variation-&gt;get_id());
  
  
      return $price * 2; // X2 for testing
  }
  </code></pre>