title: WooCommerce: Display ONLY on-sale products in Shop
body: <p>I need to create a <strong>products archive page</strong> (usually the <strong>Shop</strong> page in <strong>WooCommerce</strong>) but displays <strong>ONLY the <em>ON SALE</em> products</strong>. Basically it should use the same <strong>template layout</strong> as that in the <code>archive-product.php</code>. There will be a link in the main menu that will direct to this page. How do I go about this?</p>
  
  <h2>UPDATE</h2>
  
  <p>I managed to filter out the <strong>ON SALE</strong> products with the code below placed just above the <code>if ( have_posts() ) :</code> line...</p>
  
  <pre><code>$args = array(
      'post_type'      =&gt; 'product',
      'order'          =&gt; 'ASC',
      'paged'          =&gt; $paged,
      'meta_query'     =&gt; array(
          array(
              'key'           =&gt; '_sale_price',
              'value'         =&gt; 0,
              'compare'       =&gt; '&gt;',
              'type'          =&gt; 'numeric'
          )
      )
  );
  
  query_posts( $args );
  </code></pre>
  
  <p>The code is placed in a <strong>copy</strong> of <code>archive-product.php</code> which I named <code>archive-product_sale.php</code> and made as a <strong>page template</strong>.</p>
  
  <p>However, this only works for <strong>Simple products</strong> type and I need it to work for both <strong>Simple</strong> products and <strong>Variable</strong> products type.</p>