Remove sort by Average Rating
-
Hello. How can I remove the sort by “Average Rating” from the filter?
Hello,
Thank you very much for choosing our theme and for contacting us.
HTML structure does not allow solving it by custom CSS. Such modification requires complicated Woocommerce code customization which is not covered by our support.
Best Regards
But the widget you are using for this purpose is Basel Woocommerce Sort By. Isn’t this a custom-made widget by your team?
The php code below works in another theme I use but not in yours:
function my_woocommerce_catalog_orderby( $orderby ) {
unset($orderby["popularity"]); // Remove "Sort by popularity"
unset($orderby["rating"]); // Remove "Sort by average rating"
unset($orderby["date"]); // Remove "Sort by newness"
return $orderby;
}
add_filter( "woocommerce_catalog_orderby", "my_woocommerce_catalog_orderby", 20 );
Can’t you at least tell me what function name should I use?
Hello,
Please provide the screen and page URL of the sorting you mean. The widget can be removed in Appearance > Widgets > Shop page widget area.
Best Regards