How to show product catalog in woocommerce based on date descending order?

You can show product catalog in woocommerce based on date descending order.

For showing the product based on date descending order or asc order you have to use a filter in your child theme or current theme.

Open funcation.php in your theme.

You can find funcation.php in the root of your theme.

Update this code and this code will replace the soft order of product to based on date descending order.

--------------------

add_filter('woocommerce_default_catalog_orderby', 'custom_default_catalog_orderby');
 
function custom_default_catalog_orderby( $sort_by ) {
    return 'date desc';
}

Comments