I have 3 levels deep product categories like following :
I want to get B, but don't know how to do. I can get all product categories, but don't know how to filter out.
Here the code I use to get product categories : ID, 'product_cat' );
foreach( $product_category as $cat ): if( 0 == $cat->parent ) echo $cat->name; endforeach;