I have gone through a deep research to remove add to cart button in WooCommerce and i have find out several ways to do it.
- Hide the add to cart button for product page or product listings
- Hide add to cart button for specific products.
Disable Add to Cart Button for Product Page
Paste the code in WooCommerce.php
function Blog() {
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart');
return WooCommerce::instance();
}
Disable Add to Cart Button for Specific Products
Simple paste the code in functions.php
add_filter('woocommerce_is_purchasable', 'blog_specific_product');
function blog_specific_product($purchaseable_product_blog, $product) {
return ($product->id == specific_product_id (512) ? false : $purchaseable_product_blog);
}
Reference: Hide or Disable Add To Cart Button in WooCommerce