title: Get the woocommerce product price in javascript file
body: <p>I'm trying to get the woocommerce product price in a javascript(jQuery) file and I can't get php file to work. I know that somehow it needs to be linked with woocommerce. I'm not sure how.</p>
  
  <p>this is my js that calls for php file:</p>
  
  <pre><code>    $.ajax({
    url: '/get-product-price.php',
      Id: productId,
    success: function(data) {
      $('.canvas-total-price &gt; span').text(data);
    }
  });
  </code></pre>
  
  <p>and this is my <em>get-product-price.php</em> file:</p>
  
  <pre><code>&lt;?php
  $price = get_post_meta( $Id, '_regular_price', true);
  echo $price;
   ?&gt;
  </code></pre>