title: Woocommerce update price from external source
body: <p>I have issue with updating of product price from external database. I need to check price of product in every access to this position. For that I use <b>the_post</b> hook. For example I got '1718' price value for single product.</p>
  
  <pre><code>function chd_the_post_action( $post ) {
      if ( $post &amp;&amp; $post-&gt;post_type == 'product' ) {
          $product = wc_get_product( $post-&gt;ID );  
          if ( $product ) {
              $price = '1718';
              $product-&gt;set_price( "$price" );    
              $product-&gt;set_regular_price( "$price" );    
              $product-&gt;set_sale_price( "$price" );    
              $product-&gt;save();
          }
      }
  }
  </code></pre>
  
  <p>This code update product price in database, but it's not change view of price on page in the same moment, but only after page reload because post and product variables was setup by <b>setup_postdata()</b>.
  Therefore I use woocommerce hook for display updated price:</p>
  
  <pre><code>function chd_get_price_filter( $price, $item ) {
      return '1718';
  }
  add_filter( 'woocommerce_product_get_price', 'chd_get_price_filter', 100, 2 );
  add_filter( 'woocommerce_product_get_regular_price', 'chd_get_price_filter', 100, 2 );
  add_filter( 'woocommerce_product_get_sale_price', 'chd_get_price_filter', 100, 2 );
  </code></pre>
  
  <p>Is there any hook in which I can do this action in better way?</p>