title: Get on sale products for Woocommerce product category archives using a Get request
body: <p>I want to be able to show only products on sale for any of the categories I have on my website. I have seen that you can use <a href="https://docs.woocommerce.com/document/woocommerce-shortcodes/" rel="nofollow noreferrer">Woocommerce shortcodes</a>.</p>
  
  <p>However my Wordpress theme is dynamic (it runs for all product categories) and I can't really create one page using a shortcode for each of the product categories (some categories are created "on the go" when I add new products).</p>
  
  <p>Is there any way I can simply have a query string to return the category with only on sale products?</p>
  
  <p>For example: <code>https://www.website.com/clothing/dresses?on_sale=true</code></p>
  
  <p>---EDIT:---</p>
  
  <p>I am not using shortcodes, just want a simple solution for the query parameter.</p>
  
  <p>Forgot to mention that on my case I always have values on the "_regular_price" and "_sale_price" regardless if is on sale or not. Here are the examples:</p>
  
  <p>Product <strong>ON SALE</strong> (prices are different):
  <a href="https://i.stack.imgur.com/Jcf9L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jcf9L.png" alt="enter image description here"></a></p>
  
  <p>Product <strong>NOT</strong> on sale (prices are the same):
  <a href="https://i.stack.imgur.com/GZgAC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GZgAC.png" alt="enter image description here"></a></p>