Dont modify attributes orderby when ordering by name
This commit is contained in:
parent
0566708744
commit
fdef6b4c73
|
@ -480,6 +480,12 @@ function wc_terms_clauses( $clauses, $taxonomies, $args ) {
|
||||||
|
|
||||||
foreach ( (array) $taxonomies as $taxonomy ) {
|
foreach ( (array) $taxonomies as $taxonomy ) {
|
||||||
if ( taxonomy_is_product_attribute( $taxonomy ) || in_array( $taxonomy, apply_filters( 'woocommerce_sortable_taxonomies', array( 'product_cat' ) ), true ) ) {
|
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;
|
$found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue