transmitstudio
6/10/2016 - 11:56 PM

Customize the WooCommerce product sorting options

Customize the WooCommerce product sorting options

// Customizes the WooCommerce product sorting options
// Available options are: menu_order, rating, date, popularity, price, price-desc
function custom_woocommerce_product_sorting( $orderby ) {
  // The following removes the rating, date, and the popularity sorting options;
  // feel free to customize and enable/disable the options as needed. 
  unset($orderby["rating"]);
  unset($orderby["date"]);
  unset($orderby["popularity"]);
  return $orderby;
}
add_filter( "woocommerce_catalog_orderby", "custom_woocommerce_product_sorting", 20 );