title: How can I check if a product is part of a grouped product (WooCommerce)
body: <p>Currently my function only checks if the product is type 'external' before execution, how can I change the function to check if the product is part of a 'grouped' woocommerce product. Then echo the button which contains the parent product permalink which has already been configured.</p>
  
  <p>This is how I would like the code to run (if product is child of grouped product - show permalink button)</p>
  
  <p>I no longer wish to check if the product is type external.</p>
  
  <pre><code>function parent_permalink_button() {
      global $post;
      if( function_exists('get_product') ){
          $product = get_product( $post-&gt;ID );
          if( $product-&gt;is_type( 'external' ) ){
              $permalink = get_permalink($post-&gt;post_parent);
              echo '&lt;a class="button" href="'.$permalink.'"&gt;Compare Deals&lt;/a&gt;';
          }
      }
  }
  </code></pre>