I’m trying to remove the add to cart button from a specific category of products both in the archive page and on the products themselves.
My understanding was that to accomplish this you can add code similar to this to the functions.php page of the child theme.
function remove_add_to_cart_buttons() {
if( is_product_category(‘cars’) ) {
remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’ );
}
}
add_action( ‘woocommerce_after_shop_loop_item’, ‘remove_add_to_cart_buttons’, 1 );
It’s not working. Any help would be great!