Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1461617

    I’m trying to remove the sorting in a webshop.
    I already added this in funcions.php:
    /* WooCommerce sorteeropties verwijderen */
    remove_action( ‘woocommerce_before_shop_loop’, ‘woocommerce_catalog_ordering’, 30 );
    This didn’t work.
    Then I added this in an Snippets plugin. That didn’t work either.
    What I want is to remove both dropdowns.
    Can you help me?

    #1461649

    Hey Maureen,

    Thank you for the inquiry.

    To disable the product sorting, please add this filter in the functions.php file:

    add_action( 'woocommerce_before_shop_loop', 'avia_woocommerce_frontend_search_params', 20 );
    

    Best regards,
    Ismael

    #1463069

    I was curious about this too, but this did not appear to work. Further, I have asked in another thread if these elements can be moved to bottom of pages. Thanks.

    #1463129

    Hi,
    To remove the sorting try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function remove_avia_woocommerce_frontend_search_params() {
        remove_action( 'woocommerce_before_shop_loop', 'avia_woocommerce_frontend_search_params', 20 );
    }
    add_action( 'wp_loaded', 'remove_avia_woocommerce_frontend_search_params' );
    if ( ! function_exists( 'avia_woocommerce_frontend_search_params' ) ) {
        function avia_woocommerce_frontend_search_params() {
        }
    }
    

    To move the sorting to the bottom of the page, try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function modify_avia_woocommerce_frontend_search_params_hook() {
        remove_action( 'woocommerce_before_shop_loop', 'avia_woocommerce_frontend_search_params', 20 );
        add_action( 'woocommerce_after_shop_loop', 'avia_woocommerce_frontend_search_params', 20 );
    }
    add_action( 'wp_loaded', 'modify_avia_woocommerce_frontend_search_params_hook' );

    Best regards,
    Mike

    #1465658

    Thank you, Mike, it works!

    #1465682

    Hi,

    Great, I’m glad that Mike could help you out. Please let us know if you should need any further help on the topic, or if we can close it.

    Best regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.