Add a new custom default ordering catalog option in Woocommerce
问题 I am trying to get the default order of Woocommerce to be order by SKU. I have changed the order in the woocommerce settings and added SKU like this: function sv_add_sku_sorting( $args ) { $orderby_value = isset( $_GET['orderby'] ) ? wc_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) ); if ( 'sku' == $orderby_value ) { $args['orderby'] = 'meta_value'; $args['order'] = 'asc'; // ^ lists SKUs alphabetically 0