Layered nav should use base link

This commit is contained in:
Mike Jolley 2019-01-30 16:29:01 +00:00
parent e129d18c00
commit 5b57cb5356
1 changed files with 2 additions and 1 deletions

View File

@ -405,6 +405,7 @@ class WC_Widget_Layered_Nav extends WC_Widget {
$term_counts = $this->get_filtered_term_product_counts( wp_list_pluck( $terms, 'term_id' ), $taxonomy, $query_type );
$_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes();
$found = false;
$base_link = $this->get_current_page_url();
foreach ( $terms as $term ) {
$current_values = isset( $_chosen_attributes[ $taxonomy ]['terms'] ) ? $_chosen_attributes[ $taxonomy ]['terms'] : array();
@ -431,7 +432,7 @@ class WC_Widget_Layered_Nav extends WC_Widget {
$current_filter[] = $term->slug;
}
$link = remove_query_arg( $filter_name, $this->get_current_page_url() );
$link = remove_query_arg( $filter_name, $base_link );
// Add current filters to URL.
foreach ( $current_filter as $key => $value ) {