-
AuthorPosts
-
April 7, 2020 at 9:54 pm #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 workingany other idea?
Thank you very much.
Kind regards,
Anja
April 9, 2020 at 4:53 am #1202104Hi 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,
RikardApril 9, 2020 at 10:45 am #1202200Hey 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
April 9, 2020 at 10:55 am #1202204Hey,
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.
April 9, 2020 at 11:25 am #1202220Hey 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
April 9, 2020 at 11:55 am #1202239Hi 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,
YigitMay 5, 2020 at 10:26 am #1209870The 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');
May 5, 2020 at 10:57 am #1209880May 5, 2020 at 11:15 am #1209885Hello,
thanks, but it still does not work. I’ve added the code, cached the site but the search parameter still show.
Kind regards,
Anja
May 5, 2020 at 12:32 pm #1209917Hi,
Please create temporary admin logins and post them here privately so we can look into it :)
Best regards,
YigitMay 5, 2020 at 12:48 pm #1209923This reply has been marked as private.May 5, 2020 at 1:12 pm #1209932Hi Anja,
I added the code to functions.php file of your child theme and sorting is removed. Please review your website :)
Best regards,
YigitMay 5, 2020 at 1:28 pm #1209935This reply has been marked as private.May 5, 2020 at 1:38 pm #1209943Hey 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!
YigitMay 5, 2020 at 1:48 pm #1209947This reply has been marked as private.May 5, 2020 at 1:51 pm #1209949Hi,
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!
YigitMay 5, 2020 at 1:54 pm #1209953yes, you’re right, it’s working now. Thanks a lot.
happy day too you.
Kind regards,
Anja
May 5, 2020 at 2:07 pm #1209961 -
AuthorPosts
- The topic ‘Removing Sort by on WooCommerce Shop Page’ is closed to new replies.