• Resolved matlabiir

    (@matlabiir)


    Hi
    How To Remove Some Options From The “Sort-By” List?
    For example, delete the option based on popularity
    Please help me how to do this.
    Thanks

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Mirko P.

    (@rainfallnixfig)

    Hello @matlabiir,

    Apologies for the delayed response here.

    You can remove the “sort-by” list for popularity by adding this code snippet that I’ve found on this article:

    // Edit WooCommerce dropdown menu item of shop page//
    // Options: menu_order, popularity, rating, date, price, price-desc
     
    function my_woocommerce_catalog_orderby( $orderby ) {
        unset($orderby["popularity"]);
        return $orderby;
    }
    add_filter( "woocommerce_catalog_orderby", "my_woocommerce_catalog_orderby", 20 );

    Add the code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin.

    I hope this helps!

    Thread Starter matlabiir

    (@matlabiir)

    Hi @rainfallnixfig
    I tested this on Enfold template, it did not work.
    Thank you for your response

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How To How Remove Some Options From The “Sort-By” List?’ is closed to new replies.