How to get the parent product category ID, Name, etc in specific product? Just copy and paste the codes below.
$object = get_queried_object(); $product_cat = get_the_terms( $object->ID, 'product_cat' ); echo $product_cat[0]->name; echo wpautop( $product_cat[0]->description );
Leave a Reply