I used this code to try and display the child category of products
global $post, $product;
$cat_count = sizeof( get_the_terms( $post->ID, 'product_cat' ) );
?>
<h1 itemprop="name" class="product_title entry-title"><?php the_title(); ?></h1>
<h3 itemprop="name" class="product_title entry-title">by <?php echo $product->get_categories(); ?></h3>
Now, this code is giving both the parent and child category separated by a comma. Can you suggest a simpler way to just display the child category and not the parent category?