Woocommerce – Order by price, date or title on shop page

with Sem comentários

Ordering product by price, date and title is a good way to help customers sort out the products in your site. The following snippet helps you to order the products by price, date or the title.

add_filter('woocommerce_default_catalog_orderby', 'custom_default_catalog_orderby');
function custom_default_catalog_orderby() {
return 'date'; // Can also use title and price