Ajax Product Filter - Widget "Filter by Categories" - Show also empty categories

It is possible with a little customization. Please, follow this steps:

 1. Go in wp-content/themes/YOUR_THEME_FOLDER and look for functions.php file. Open this file and past this code at the end of file:
 
if( function_exists( 'YITH_WCAN' ) ){
add_filter( 'yit_get_terms_args', 'yit_get_terms_args' );
add_filter( 'yith_wcan_skip_no_products_in_category', '__return_false' );
add_filter( 'yith_wcan_force_show_count_in_category', '__return_true' );
if( ! function_exists( 'yit_get_terms_args' ) ){
function yit_get_terms_args( $args ){
if( ! empty( $args['taxonomy'] ) && 'product_cat' == $args['taxonomy'] ){
$args['hide_empty'] = false;
}
return $args;
}
}
}

2. Download the file class.yith-wcan-navigation-widget-premium.php attached to this post

3. Copy the file class.yith-wcan-navigation-widget-premium.php in wp-content/plugins/yith-woocommerce-ajax-product-filter.premium/widgets/. You can override the existing file. 
 
 
NOTE: For versions up to 3.1.2 is not necessary to perform steps 2 and 3
Was this article helpful?
0 out of 0 found this helpful

Back to Help Center

Powered by Zendesk