Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3888
    Avatartina871223
    Support Expired

    hi
    I would like change the “default sorting” in shop page,how can i do this
    please see screenshot
    https://paste.pics/17bc65b6efedf16caab8c71bd3db7e3b
    thank you very much

    #3898

    Hi you,

    To change default sorting in shop page, please add this code to file functions.php ( child-theme):

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

    Possible values are:

    menu_order (Default) – by the custom order first, then by product name
    popularity – by the number of sales
    rating – by the average rating
    date – recently added products will be displayed first
    price – cheapest products will be displayed first
    price-desc – the most expensive first
    rand – in a random order (read also how to retain pagination in this case)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.