I’ve removed Add to Cart button from Shop and Category pages, but how about Related Products section that is below a product page? The code below doesn’t work for that.
function remove_add_to_cart_buttons() {
if( is_product_category() || is_shop()) {
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', 10 );
2
Answers
You could try using custom CSS as below. Put it under Appearance -> Customizer -> Custom CSS under your admin panel.
Here’s the code for the same:
The reason being that the ‘Add to Cart’ button is displayed on these two actions.