title: Make is_purchasable hook work with variations and product tags In Woocommerce
body: <p>I'm trying to prevent that visitors buying certain products based on product tags.</p>
  
  <p>I'm using <code>'woocommerce_is_purchasable'</code>woocommerce filter but it doesn't work with variable products.</p>
  
  <p>This is my code:</p>
  
  <pre><code>    function remove_add_to_cart_for_tag_id ( $purchasable, $product ){
  
      if( $product-&gt;get_tag_ids() == array(181)) {
  
        $purchasable = false;
  
      } else {
        return $purchasable;
      }
  
      if ( $purchasable &amp;&amp; $product-&gt;is_type( 'variation' ) ) {
          $purchasable = $product-&gt;parent-&gt;is_purchasable();
      }
  
      return $purchasable;
  
  }
  add_filter( 'woocommerce_is_purchasable', 'remove_add_to_cart_for_tag_id', 10, 2 );
  add_filter( 'woocommerce_variation_is_purchasable', 'remove_add_to_cart_for_tag_id', 10, 2 );
  </code></pre>
  
  <p>I've based my code on this example: <a href="https://stackoverflow.com/questions/49473854/get-is-purchasable-hook-working-for-woocommerce-product-variations-too">Get is_purchasable hook working for Woocommerce product variations too</a></p>
  
  <p>Any comment is well received, thanks in advance.</p>