<?php
$prod_cat = get_field('related_prod_cat');
$prod_args = array(
  'post_type'=>'product',
  'posts_per_page'  => 3,
  'tax_query' => array(
		array(
			'taxonomy' => 'product_cat',
			'field'    => 'id',
			'terms'    => $prod_cat,
		),
	),
);
$prod_posts = new WP_Query($prod_args);
if ($prod_posts->have_posts()) :
  echo '<div class="related-products">';?>
    <h3 class="widget-title"><?php _e('Prodotti correlati','blanka');?></h3>
    <?php while($prod_posts->have_posts()) : $prod_posts->the_post();
      get_template_part('inc/teaser/_teaser', 'product');
    endwhile;
  echo '</div><!--related-->';
endif;
wp_reset_query();?>
