Product category names and descriptions in Woocommerce Single Product page

Share Now

<?php 
    foreach( wp_get_post_terms( get_the_id(), 'product_cat' ) as $term ){
        if( $term ){
            echo $term->name . '<br>'; // product category name
            if ($term->description)
                echo $term->description . '<br>'; // Product category description
        }
    }
?>
Picture of Nahid Mahamud

Nahid Mahamud

Web Developer | Graphic Designer | WordPress & Woo-commerce Expert