Created
July 12, 2021 14:05
-
-
Save jorpdesigns/f517ed711c28d777f8c5a8d06d8a96f8 to your computer and use it in GitHub Desktop.
Snippet to remove WooCommerce catalogue sorting option
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// orderby values are date, menu_order, popularity, rating, date, price, price-desc | |
add_filter( 'woocommerce_catalog_orderby', 'custom_woocommerce_catalog_orderby', 20 ); | |
function custom_woocommerce_catalog_orderby( $orderby ) { | |
unset($orderby["price"]); // Remove price option | |
return $orderby; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment