Display a list subcategories under the main product category thumbnails?

Ok so after some more searching online and using the right combination of search terms I stumbled across this guide here:

https://www.themelocation.com/how-to-display-all-the-subcategories-from-a-specific-category-in-woocommerce/

From that guide I created this snippet of code that can be added to your theme’s functions.php file so that the subcategory list appears under the main category title in the main categories loop. No modification of the content-product-cat.php template needed. So if anybody else needs the code here it is:

// Adding Child Category List to Main Category Display Grid

add_action('woocommerce_after_subcategory_title', 'woocommerce_subcats_from_parentcat_by_ID', 20);

function woocommerce_subcats_from_parentcat_by_ID($category) {
    $parent_category_ID = $category->term_id;
    $args = array(
        'hierarchical' => 1,
        'show_option_none' => '',
        'hide_empty' => 0, // Set to 0 to show empty categories and 1 to hide them
        'parent' => $parent_category_ID,
        'taxonomy' => 'product_cat'
    );
    $subcategories = get_categories($args);
    echo '<ul class="woo_subcategory_list">';
    foreach ($subcategories as $subcategory) {
        $link = get_term_link( $subcategory->slug, $subcategory->taxonomy );
        echo '<li><a href="'. $link .'">'.$subcategory->name.'</a></li>';
    }
    echo '</ul>';
}