I recently launched an ecommerce website where all the products have a standard price. With the use of analytical tools such as Hotjar, I observed some of my users trying to sort the shop items by “Price: Low to High” which unfortunately made no difference considering everything is priced at £7.50.
This was providing a poor user experience and as such, I decided the best action was to remove some sort options from my shop drop down.
I did this by adding the following code to my functions.php file, remember, before editing your theme files be sure to make a backup in case anything breaks:
// Removes drop down sorting options// // Options: menu_order, popularity, rating, date, price, price-desc function my_woocommerce_catalog_orderby( $orderby ) { unset ($orderby["price-desc"]); return $orderby; } add_filter( "woocommerce_catalog_orderby", "my_woocommerce_catalog_orderby", 20);
Was this article helpful?
YesNo
Hi. Is there a way how to remove this sorting button? I spent my whole day fixing it, any ideas?
You can add this to your functions.php file
add_action( 'before_woocommerce_init', function() {
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
} );