title: Remove add to cart for variable products with no price in Woocommerce
body: <p>I'm currently trying to build a woocommerce site with a some simple products but mostly variable products.</p>
  <p>I've managed to add some php which will remove the price if the product is either priced at 0 or has no price at all, but I need to remove the &quot;add to cart&quot; button too.</p>
  <p>When i try to add any further filters such as this one</p>
  <pre><code>add_filter( 'woocommerce_is_purchasable', 'remove_add_to_cart_option', 10, 2 );
  function remove_add_to_cart_option( $purchasable, $product ) {
  
      if( $product-&amp;gt;get_price() == 0 )
          $purchasable = false;
      return $purchasable;
  }
  </code></pre>
  <p>it crashes the site (I'm using my custom functions to edit the function php). Here is the full code...</p>
  <pre><code>    // Variable and simple product displayed prices
  add_filter( 'woocommerce_get_price_html', 'empty_and_zero_price_html', 20, 2 );
  function empty_and_zero_price_html( $price, $product ) {
      $empty_price = __(' ','woocommerce');
  
      if( $product-&gt;is_type('variable') )
      {
          $prices = $product-&gt;get_variation_prices( true );
  
          if ( empty( $prices['price'] ) ) {
              return $empty_price; // &lt;=== HERE below for empty price
          } else {
              $min_price     = current( $prices['price'] );
              $max_price     = end( $prices['price'] );
              if ( $min_price === $max_price &amp;&amp; 0 == $min_price ) {
                  return $empty_price; // &lt;=== HERE for zero price
              }
              elseif ( $min_price !== $max_price &amp;&amp; 0 == $min_price ) {
                  return wc_price( $max_price );
              }
          }
      }
      elseif( $product-&gt;is_type('simple') )
      {
          if ( '' === $product-&gt;get_price() || 0 == $product-&gt;get_price() ) {
              return $empty_price; // &lt;=== HERE for empty and zero prices
          }
      }
      return $price;
  }
  
  // Product Variation displayed prices
  add_filter( 'woocommerce_available_variation', 'empty_and_zero_variation_prices_html', 10, 3);
  function empty_and_zero_variation_prices_html( $data, $product, $variation ) {
  
      if( '' === $variation-&gt;get_price() || 0 == $variation-&gt;get_price() )
          $data['price_html'] = __(' ','woocommerce'); // &lt;=== HERE for empty and zero prices
  
      return $data;
  }
  
  add_filter( 'woocommerce_is_purchasable', 'remove_add_to_cart_option', 10, 2 );
  function remove_add_to_cart_option( $purchasable, $product ) {
      
      if( $product-&amp;gt;get_price() == 0 )
          $purchasable = false;
      return $purchasable;
  }
  </code></pre>