In the code below, I need to put a comma at the end of the author names.
foreach($terms as $term){
echo '<a href="'.esc_url(get_term_link( $term, 'product_author' )).'">'.esc_html($term->name).'</a>';
}
Example: A, B, C
Note: 1. A comma is not required if the author is one.
2. There is no need for a comma after the last author's name.