From 5ff18ebb12789b680965576539c35447c3bbb971 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 15 Jun 2016 00:09:32 +0100 Subject: [PATCH] Layered nav dropdowns - When getting counts, use 'or' to exclude self. We don't need 'and' because dropdown fields can only choose 1 option anyway. #11123 --- includes/widgets/class-wc-widget-layered-nav.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/widgets/class-wc-widget-layered-nav.php b/includes/widgets/class-wc-widget-layered-nav.php index 310511ebf30..7c8a0cd2e41 100644 --- a/includes/widgets/class-wc-widget-layered-nav.php +++ b/includes/widgets/class-wc-widget-layered-nav.php @@ -216,7 +216,8 @@ class WC_Widget_Layered_Nav extends WC_Widget { $found = false; if ( $taxonomy !== $this->get_current_taxonomy() ) { - $term_counts = $this->get_filtered_term_product_counts( wp_list_pluck( $terms, 'term_id' ), $taxonomy, $query_type ); + // When getting counts, use 'or' to exclude self. We don't need 'and' because dropdown fields can only choose 1 option anyway. + $term_counts = $this->get_filtered_term_product_counts( wp_list_pluck( $terms, 'term_id' ), $taxonomy, 'or' ); $_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes(); $taxonomy_filter_name = str_replace( 'pa_', '', $taxonomy );