title: Get WooCommerce products on sale with WC_Query
body: <p>I know there are plenty of solutions on the internet about how to get WooCommerce products on sale, by doing a <strong>WP_Query</strong>. However, WooCommerce doesn't seem to work fully if it's <strong>WC_Query</strong> object is not populated. For example: filter or sorting</p>
  
  <p>Both these templates call:</p>
  
  <pre><code>woocommerce_products_will_display()
  </code></pre>
  
  <p>Which check's to see if the page is a taxonomy page (obvious false if you're using your own custom template): </p>
  
  <pre><code>if ( ! is_product_taxonomy() ) return false;
  </code></pre>
  
  <p>This is an example of a simple solution if you just want the products: <a href="https://stackoverflow.com/questions/20990199/woocommerce-display-only-on-sale-products-in-shop">WooCommerce: Display ONLY on-sale products in Shop</a></p>
  
  <p>So, I there seems to be a couple of issues I need to solve here:</p>
  
  <p>1) How to tell WC that my "Sale" page is a taxonomy page? Is there some sort of trick I need to do to force it into a taxonomy?</p>
  
  <p>2) How do I get get WC_Query filled with the sales query (rather than just the WP_Query)</p>
  
  <p>I have plugins that depend on:</p>
  
  <pre><code>$woocommerce-&gt;query-&gt;layered_nav_product_ids
  </code></pre>
  
  <p>being populated.</p>
  
  <p>Any help is appreciated!
  Thanks!!!</p>