Tel: 0115 888 2772

WooCommerce, How to Filter Products by Price as Default

Posted on: January 7th, 2016 by carnfield

It’s one we keep getting asked, and it’s one that’s very simple to fix.

So if you’re stuck with the default filtering making your life hell with WooCommerce, look no futher, the answer is finally at hand!
It involves opening your WordPress Theme’s functions.php and adding this very simple text snipping:-


// WooCommerce Result Filter by Price Low>High
add_filter('woocommerce_default_catalog_orderby', 'my_custom_default_catalog_orderby');
function my_custom_default_catalog_orderby() {
return 'price';
}

And that’s it!  You’re up and running, all categories with products will filter by Price Low > High!  You can change the return ‘price’ to whatever else you would like WooCommerce to Default filter to!

Tags: , , , , ,

Leave a Reply