I'm trying to display a list of woocommerce product subcategories, including any sub-sub-categories (children of) - how can I modify the following code to do this - which displays a list of categories from cat ID 51:
$wcatTerms = get_terms('product_cat', array('hide_empty' => 0, 'orderby' => 'ASC', 'parent' => 51, 'hierarchical' => 1 ));
foreach($wcatTerms as $wcatTerm) :
$wthumbnail_id = get_woocommerce_term_meta( $wcatTerm->term_id, 'thumbnail_id', true );
$wimage = wp_get_attachment_url( $wthumbnail_id );
?>
<a class="cat-items" href="<?php echo get_term_link( $wcatTerm->slug, $wcatTerm->taxonomy ); ?>"><h3><?php echo $wcatTerm->name; ?></h3></a>