title: Get WooCommerce product regular price and sale price from a WP_Query
body: <p>I run mass discounts in a specific category successfully (lets say -50% in category id 123) and everything runs smoothly in product grid, product page and orders. (Wordpress 5.7, Woocommerce:  5.1.0, tried various mass-discount plugins)</p>
  <p>However the problem is that when I try to print a list in an admin page through a small plugin I made, I can not get the sale price</p>
  <p>I tried:</p>
  <pre><code>global $woocommerce;
  $args = array('post_type'=&gt;'product','post_status'=&gt;'publish','ignore_sticky_posts'=&gt;1);
  $query = new WP_Query( $args );
  $query = new WP_Query( $args );
  if ( $query-&gt;have_posts() ) {
      while ( $query-&gt;have_posts() ) : $query-&gt;the_post();
          global $product;
          $product = wc_get_product( get_the_ID() );
          echo $product-&gt;get_sale_price().&quot;&lt;br&gt;&quot;; //prints empty
          echo $product-&gt;get_price().&quot;&lt;br&gt;&quot;; //prints the initial price
          echo wc_price( wc_get_price_including_tax( $product ) ).'&lt;br&gt;'; //prints the initial price
          echo $product-&gt;get_variation_sale_price( 'min', true ).'&lt;br&gt;'; //prints the initial price
          if ( $product-&gt;is_on_sale() ){
              echo 'is on sale&lt;br&gt;'; //it never prints so it does not recognise the product as in sale
          }
      endwhile;
  }
  </code></pre>
  <p>Why is there no sale price? How can I get it? Most products have variations. The product page has the sale price in all products in the category that the sale runs.</p>