Hi, So I added this code to disable the add to cart button and add a Whatsapp chat button in the place. Replace categoryname with the actual category
add_action( 'woocommerce_single_product_summary', 'extra_button_on_product_page', 22 );
function extra_button_on_product_page() {
global $post, $product;
if ( has_term( 'categoryname', 'product_cat' ) ) {
add_filter( 'woocommerce_is_purchasable', '__return_false');
echo do_shortcode('[whatsappsupport number="919999999999" text="Contact us to place the order" text-color="#fff" bg-color="#22c15e" message="Hi Im looking for this product... Need some information regarding the same." ]');
echo '<p> </p>';
}
}
So this did solve my purpose of disabling the add to cart on the product page but in the shop page when I hover over a product it still shows all the 4 buttons and the add to cart is actually adding to cart.
Is there a way to disable the add to cart only on this particular category?