You can use get_term_link to get the URL of Product. Category ID needed to be converted to an integer.
$woo_cat_id_int = (int)$woo_cat_id; $term_link = get_term_link( $woo_cat_id, 'product_cat' ); echo '<a href="' . esc_url( $term_link ) . '">' . $term->name . '</a>'; |
If you have the term Object then you can simply get the link by using below code
$term_link = get_term_link( $term ); echo '<a href="' . esc_url( $term_link ) . '">' . $term->name . '</a>'; |