By default WooCommerce show my categories and subcategories like the image I am posting.
Is it possible to hide the subcategory Test and only show the Test sub category when you click the main category which is Furniture?
Here is the html code for my page and the CSS I have used:
aside#woocommerce_product_categories-2 ul li:nth-child(4) ul {
display: none;
}
aside#woocommerce_product_categories-2 ul li:nth-child(4):hover > ul {
display:block
}
<aside id="woocommerce_product_categories-3" class="widget woocommerce widget_product_categories">
<h5 class="widgettitle">Product Categories</h5>
<ul class="product-categories">
<li class="cat-item cat-item-28"><a href="http://saltandpepper.workshopcy.com/product-category/accessories/">accessories</a></li>
<li class="cat-item cat-item-29"><a href="http://saltandpepper.workshopcy.com/product-category/clothes/">clothes</a></li>
<li class="cat-item cat-item-30"><a href="http://saltandpepper.workshopcy.com/product-category/flowers/">flowers</a></li>
<li class="cat-item cat-item-38 cat-parent current-cat-parent"><a href="http://saltandpepper.workshopcy.com/product-category/furniture/">Furniture</a>
<ul class="children">
<li class="cat-item cat-item-41 current-cat"><a href="http://saltandpepper.workshopcy.com/product-category/furniture/test/">Test</a></li>
</ul>
</li>
<li class="cat-item cat-item-31"><a href="http://saltandpepper.workshopcy.com/product-category/home-furnishings/">home furnishings</a></li>
<li class="cat-item cat-item-32"><a href="http://saltandpepper.workshopcy.com/product-category/souvenirs/">souvenirs</a></li>
</ul>
</aside>
It works but I am not sure if this will be a viable option if you have too many categories and subcategories and products...
Thank you for your help.