title: WooCommerce get product id and price in function.php
body: <p>I am trying to fetch the product id and price in functions.php, so i can use that price in my hooks right now i am using this code and</p>
  
  <p>i am getting </p>
  
  <pre><code>    ID=0(id is like 99, 1733 etc)
      price = Free(but default price is something else)
  
    $product = new WC_Product( get_the_ID()) ;
    echo $prices = $product-&gt;get_price_html();
    echo $price1= $product-&gt;id;
  </code></pre>
  
  <p>Any help will be much appreciated!</p>