title: How to display related product price on another single product page
body: <p>I would like to display few related products on a single product page, custom picked. I am using ACF plugin with Relations field. I am trying this code but it returns current product price, rather than the related products prices (in foreach):</p>
  
  <pre><code>&lt;?php 
     $product = new WC_Product(get_the_ID()); 
    echo wc_price($product-&gt;get_price_including_tax(1,$product-&gt;get_price()));
  ?&gt;
  </code></pre>
  
  <p>the code works fine on static pages, and prices for few related products are correct, but not on a single page product. I thought that the part 
      get_the_ID()
  handles targeting of specific post?</p>
  
  <p>UPDATE:</p>
  
  <p>Here is my whole code including ACF relation field:</p>
  
  <pre><code>&lt;?php 
      $posts = get_field('related_set_1');
      if( $posts ): ?&gt;
  &lt;?php foreach( $posts as $p): ?&gt;
      &lt;li&gt;
          &lt;a href="&lt;?php echo get_permalink( $p-&gt;ID ); ?&gt;"&gt;
              &lt;?php 
                echo get_the_post_thumbnail( $p-&gt;ID, '175x100' )
                      ?&gt;
                  &lt;div style="overflow:hidden"&gt;
                      &lt;h4&gt;&lt;?php echo $p-&gt;post_title; ?&gt;&lt;/h4&gt;
                      &lt;p class="price"&gt;
                          &lt;?php 
                          global $post;
                          $product = new WC_Product($post-&gt;ID); 
                          echo wc_price($product-&gt;get_price_including_tax(1,$product-&gt;get_price()));
                          ?&gt;
                      &lt;/p&gt;
                      &lt;p class="link"&gt;View now&lt;/p&gt;
                  &lt;/div&gt;
          &lt;/a&gt;
      &lt;/li&gt;
      &lt;?php endforeach; ?&gt;
          &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>I also added global $post; from reply below but I still have the same output: the price displayed is the price of the product on the page where the code is placed, not the product in the 'related items' grid.</p>
  
  <p>And I use this in functions.php in filter function, if that makes any difference?</p>
  
  <pre><code>add_filter( 'woocommerce_after_single_product_summary', 'custom_related_products' );
  function custom_related_products() { ?&gt;
  .... (the code above here)
  &lt;php? }
  </code></pre>
  
  <p>everything works well, apart the price.</p>