Fix Layered navigation permalinks issue on category page

This commit is contained in:
Serg 2016-06-14 12:35:52 +03:00
parent 5a1388ee97
commit 60a4da9660
1 changed files with 4 additions and 0 deletions

View File

@ -267,6 +267,10 @@ class WC_Widget_Layered_Nav extends WC_Widget {
$link = home_url();
} elseif ( is_post_type_archive( 'product' ) || is_page( wc_get_page_id('shop') ) ) {
$link = get_post_type_archive_link( 'product' );
} elseif( is_product_category() ) {
$link = get_term_link( get_query_var('product_cat'), 'product_cat' );
} elseif( is_product_tag() ) {
$link = get_term_link( get_query_var('product_tag'), 'product_tag' );
} else {
$link = get_term_link( get_query_var('term'), get_query_var('taxonomy') );
}