The Blog

Order Products by ‘On Sale’ in WooCommerce

Have you ever wanted to place your on sale items at the top of your product listings? You can pretty easily do it in a couple of ways.

If you would like to add a ‘On Sale’ option to the ‘orderby’ menu, so users can choose to order it themselves, add the following code to the ‘custom functions’ area of your functions.php file:

However, if you would like to make it the default order, add this:

I hope that helps you out!

Introducing Metorik

For

A single dashboard unifying your store's orders, customers, and products, helping you understand your data and make more informed decisions.