Unable to pull in custom product attribute in shortcode [closed]

In case anyone needs it, here was my final code:

<?php 
//LIST ALL DOCUMENTS
add_shortcode('listDocs','listDocs');
function listDocs(){
    $params = array(
        'paged' => get_query_var('paged', 1),
        'posts_per_page' => 25, 
        'post_type' => 'product',
        'product_cat' => 'documents'
      );
  $wc_query = new WP_Query($params);
      while ($wc_query->have_posts()) {
           $wc_query->the_post(); 
           $product_id = get_the_ID();
           $product = wc_get_product($product_id);
           $author = $product->get_attribute('written-by');
           $date = get_the_date('F Y', $product_id);
           $output .= '<h3 style="padding: 10px 0px 0px 0px;margin: 0px;"> <a href="' . get_the_permalink() . '">' . get_the_title() . '</a></h3>
           <p>' . get_field('document_type') . "https://wordpress.stackexchange.com/" .  $author . "https://wordpress.stackexchange.com/" . $date . '</p><hr>';
        }

        return $output; 


}
    ?>