title: Woocommerce Deprecated template
body: <p>I am trying to update the woocommerce deprecated templates.I managed most of them except this one.Maybe some of you can help me out.Thank you very much.</p>
  
  <p>Turned the wp debug on and i get this.</p>
  
  <p><em>Notice: WC_Product::get_related is deprecated since version 3.0! Use wc_get_related_products instead.</em></p>
  
  <p>This is the actual line ofcode now </p>
  
  <pre><code>$related = $product-&gt;get_related( $posts_per_page );
  </code></pre>
  
  <p>And I changed it to this </p>
  
  <pre><code>$related = $product-&gt;wc_get_related_products( $posts_per_page );
  </code></pre>
  
  <p>But then i get this:</p>
  
  <p><em>Fatal error: Call to undefined method WC_Product_Simple::wc_get_related_products()</em></p>
  
  <p><strong>Here is the full code</strong>,thank you.</p>
  
  <pre><code>if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  
  global $product, $woocommerce_loop;
  
  if ( empty( $product ) || ! $product-&gt;exists() ) {
      return;
  }
  
  $related = $product-&gt;wc_get_related_products( $posts_per_page );
  
  
  if ( sizeof( $related ) == 0 ) return;
  
  $args = apply_filters( 'woocommerce_related_products_args', array(
      'post_type'            =&gt; 'product',
      'ignore_sticky_posts'  =&gt; 1,
      'no_found_rows'        =&gt; 1,
      'posts_per_page'       =&gt; $posts_per_page,
      'orderby'              =&gt; $orderby,
      'post__in'             =&gt; $related,
      'post__not_in'         =&gt; array( $product-&gt;id )
  ) );
  
  $products = new WP_Query( $args );
  
  $woocommerce_loop['columns'] = $columns;
  
  if ( $products-&gt;have_posts() ) : ?&gt;
  
      &lt;div class="wc_related sugpro_box products"&gt;
  
          &lt;h2&gt;&lt;?php esc_html_e( 'Suggestions you might enjoy with this products', 'woocommerce' ); ?&gt;&lt;/h2&gt;
           &lt;div class="pro_foods_list"&gt;
          &lt;?php woocommerce_product_loop_start(); ?&gt;
  
              &lt;?php while ( $products-&gt;have_posts() ) : $products-&gt;the_post(); ?&gt;
  
                  &lt;?php wc_get_template_part( 'content', 'product' ); ?&gt;
  
              &lt;?php endwhile; // end of the loop. ?&gt;
  
          &lt;?php woocommerce_product_loop_end(); ?&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  
  &lt;?php endif;
  
  wp_reset_postdata();
  ?&gt;
  &lt;div class="recip_prod"&gt;
          &lt;h2&gt;Recipes with this products&lt;/h2&gt;
              &lt;ul class="recip_list"&gt;
  &lt;?php 
   $post_id = get_the_ID();
  $nameqry1="select * from wp_posts where ID IN (select r.rec_id from wp_posts as p ,  wp_recipes as r where p.ID=r.post_id AND p.ID=".$post_id.") AND `post_status`='publish'";  
  
  $Rquery =  mysqli_query($mysqli,$nameqry1);
  
  if(mysqli_num_rows($Rquery) &gt; 0)
  { 
      while( $rows = mysqli_fetch_assoc($Rquery))
          { ?&gt;
              &lt;li&gt;&lt;a href="&lt;?php echo get_bloginfo('url');?&gt;/search-recipes/?rc-page=&lt;?php echo $rows['ID']?&gt;"&gt;&lt;?php  echo $rows['post_title'];?&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;?php   }
  }else{
      echo "This Product Recipes Not Available";
  }
  ?&gt;
             &lt;/ul&gt;
          &lt;/div&gt;
  </code></pre>