How to know the number of items in the filter by attribute?

Hello. Make a menu of categories, which should be output from the filter by attribute. In principle made it static, because everything is known in advance. It turned out something like:
$menu_list .= '<li class="sidebar-menu__item"><a href="' . $menu_item->url . '" class="sidebar-menu__link">' . $menu_item->title . '</a>
 <ul class="sidebar-atr-menu">
 <li class="atr-menu one-star">
 <a href="' .$menu_item->url .'?filter_slojnost=1">Light</a>
</li>
 <li class="atr-menu two-star">
 <a href="' .$menu_item->url .'?filter_slojnost=2">Average</a> 
</li>
 <li class="atr-menu three-star">
 <a href="' .$menu_item->url .'?filter_slojnost=3">Complex</a> 
 </li> 
</ul>
 </li>

That is, the filter current category the attribute "complexity", the question is how to hide the item if the goods in filtering there.
something like
if ( count > 0 ) {

}

Maybe someone can suggest how "to occupati" number of products when I need filtration?
April 2nd 20 at 17:45
0 answer

Find more questions by tags WooCommerceWordPress