Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #1201706

    Hello,

    I’m trying to remove the “Sort by” on WooCommerce Shop Page.

    I’ve tried with

    a) adding this snippet:
    remove_action( ‘woocommerce_before_shop_loop’, ‘woocommerce_result_count’, 20 );
    remove_action( ‘woocommerce_before_shop_loop’, ‘woocommerce_catalog_ordering’, 30 );
    –> not working
    b) following this advice: https://kriesi.at/support/topic/product-grid-remove-sort-by-feature/
    –> not working

    any other idea?

    Thank you very much.

    Kind regards,

    Anja

    #1202104

    Hi Anja,

    Please try this in your functions.php file:

    add_action( 'init', 'anja_remove_woo_default_sorting' );
      
    function anja_remove_woo_default_sorting() {
       remove_action( 'woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10 );
       remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 );
    }

    Best regards,
    Rikard

    #1202200

    Hey Rikard,

    thanks. I’ve added the snipped to my child theme functions.php but it still shows the sorting. Any idea?

    Thank you very much.

    Kind regards,

    Anja

    #1202204

    Hey,

    Please try using following code in functions.php file of your child theme instead

    
    function avia_remove_<a href='https://refer.wordpress.com/r/84/woocommerce/' target='_blank' rel="nofollow">woocommerce</a>_frontend_search_params() { 
    remove_action('<a href='https://refer.wordpress.com/r/84/woocommerce/' target='_blank' rel="nofollow">woocommerce</a>_before_shop_loop','avia_<a href='https://refer.wordpress.com/r/84/woocommerce/' target='_blank' rel="nofollow">woocommerce</a>_frontend_search_params', 20);
    } 
    add_action( 'init', 'avia_remove_<a href='https://refer.wordpress.com/r/84/woocommerce/' target='_blank' rel="nofollow">woocommerce</a>_frontend_search_params');

    Best regards,
    Yigit

    • This reply was modified 4 years, 7 months ago by Yigit.
    #1202220

    Hey Yigit,

    thanks for the quick feedback. I’ve added the snippet accordingly but the sorting still shows. Another idea?

    Thank you very much.

    Kind regards,

    Anja

    #1202239

    Hi Anja,

    Have you flushed cache? If you have, please create temporary admin logins and post them here privately so we can look into it :)

    Best regards,
    Yigit

    #1209870

    The code provided on April 9th works but it needs to have the word “please” removed

    function avia_remove_woocommerce_frontend_search_params() { 
    remove_action('woocommerce_before_shop_loop','avia_woocommerce_frontend_search_params', 20);
    } 
    add_action( 'init', 'avia_remove_woocommerce_frontend_search_params');
    #1209880

    Hi,


    @valentinod
    thanks for the heads up. I edited my post and corrected it :)

    Best regards,
    Yigit

    #1209885

    Hello,

    thanks, but it still does not work. I’ve added the code, cached the site but the search parameter still show.

    Kind regards,

    Anja

    #1209917

    Hi,

    Please create temporary admin logins and post them here privately so we can look into it :)

    Best regards,
    Yigit

    #1209923
    This reply has been marked as private.
    #1209932

    Hi Anja,

    I added the code to functions.php file of your child theme and sorting is removed. Please review your website :)

    Best regards,
    Yigit

    #1209935
    This reply has been marked as private.
    #1209943

    Hey Anja,

    I just checked your page but it does not show up on my end there either. Attached a screenshot in private content field below :)

    Cheers!
    Yigit

    #1209947
    This reply has been marked as private.
    #1209949

    Hi,

    Have you flushed browser cache and refreshed your page a few times? Sort does not show up on both links. Attached screenshots including urls :)

    Cheers!
    Yigit

    #1209953

    yes, you’re right, it’s working now. Thanks a lot.

    happy day too you.

    Kind regards,

    Anja

    #1209961

    Hi,

    You are welcome, Anja! Enjoy the rest of your day :)

    Best regards,
    Yigit

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘Removing Sort by on WooCommerce Shop Page’ is closed to new replies.