title: How to get variation's price from its ID inside an ajax call
body: <p>I'm trying to get a variation's price from its ID inside an ajax call. I can't figure out why wc_get_product() is returning an empty object.</p>
  <p>Here's my Javascript code for the ajax call:</p>
  <pre><code>$(document).on('change', '#product-info select', function() {
      var variation_id = $(this).find(':selected').val(),
        variation_name = $(this).find(':selected').text(),
        data = {
          action: 'woocommerce_ajax_quantity_change',
          variationid: variation_id
        };
  
      $.ajax({
        type: 'post',
        url: wc_add_to_cart_params.ajax_url,
        data: data,
        success: function(response) {
          console.log(response);
        }
      });
  });
  </code></pre>
  <p>And this is my PHP file, where the $variation is returning an empty array:</p>
  <pre><code>function woocommerce_ajax_quantity_change() {
      $variationid = empty($_POST['variationid']) ? 0 : absint($_POST['variationid']);
      $variation = wc_get_product($variationid);
      echo wp_send_json($variation);
      wp_die();
  }
  </code></pre>
  <p>$variationid is fine and returning the right variation's ID (already checked).</p>