title: Display an ACF field values in WooCommerce product archive loop
body: <p>i'm currently playing around on localhost since i'm going to design an ecommerce for a client who owns a records store. I've installed Elementor, WooCommerce and ACF, and at first tried to use elementor custom skin to create a custom loop for my products, where i easily added the field i wanted with dynamic data.
  However, this turned out to be a nightmare since being a post archive i lost the sorting etc and also for some reason the add to cart button behaved weirdly (it took me to the single product page after clicking it).
  So i've ditched that custom posts archive and used the classic product archive instead, which doesn't allow me to add anything to the product loop directly.</p>
  <p>I tried adding this code in my functions.php file (my custom field is named vinyl_genre and it's part of a custom field group):</p>
  <pre><code>add_action( 'woocommerce_after_shop_loop_item_title', 'custom_field_display_below_title', 2 );
  function custom_field_display_below_title(){
      global $product;
  
      // Display ACF text
      if( $text = get_field( 'vinyl_genre', $product-&gt;get_id() ) ) {
          echo '&lt;p class=&quot;archive-genre&quot;&gt;' . $text . '&lt;/p&gt;';
      }
  }
  </code></pre>
  <p>But it didnt work, instead below each product title in the archive i get this warning:</p>
  <p>Warning: :  Array to string conversion in <em>[...]</em> \wp-content\themes\hello-theme-child-master\functions.php  on line 36 Array</p>
  <p>I'm an absolute n00b at php, but i found the above example here on stack and just changed the field name, but to no avail.
  Any advice?</p>
  <p><strong>-- EDIT --</strong></p>
  <p>Using <code>print_r($text)</code> gives an array of values <em>(because vinyl can have multiple genres)</em></p>