Add Product Subtitle to Woocommerce Product Page

This is what I have used to show the product category as a subtitle on my shop archive page

add_action( 'woocommerce_shop_loop_item_title', 'woocommerce_shop_loop_item_subtitle', 20 );
function woocommerce_shop_loop_item_subtitle() {
    global $post, $product;
    $categ = $product->get_categories();
    echo $categ;
}

and this is what I used to display it on the single product page

add_action( 'woocommerce_single_product_summary', 'woocommerce_single_item_subtitle', 5 );
function woocommerce_single_item_subtitle() {
    global $post, $product;
    $categ = $product->get_categories();
    ?>
    <div class="cat-subtitle">
    <?php
    echo "by " ,$categ; 
?>
</div>
<?php
}

You can change what is echoed to output the field you want.