Dont modify attributes orderby when ordering by name

This commit is contained in:
claudiulodro 2018-09-20 12:32:06 -07:00
parent 0566708744
commit fdef6b4c73
1 changed files with 6 additions and 0 deletions

View File

@ -480,6 +480,12 @@ function wc_terms_clauses( $clauses, $taxonomies, $args ) {
foreach ( (array) $taxonomies as $taxonomy ) {
if ( taxonomy_is_product_attribute( $taxonomy ) || in_array( $taxonomy, apply_filters( 'woocommerce_sortable_taxonomies', array( 'product_cat' ) ), true ) ) {
// Don't modify the orderby when we're ordering attributes by name.
if ( taxonomy_is_product_attribute( $taxonomy ) && 'name' === wc_attribute_orderby( $taxonomy ) ) {
return $clauses;
}
$found = true;
break;
}