/** * Hide prices and cart buttons on individual category pages */ add_action('woocommerce_after_shop_loop_item_title', 'cc_hide_loop_product_prices', 1); function cc_hide_loop_product_prices(){ global $product; if(is_product_category(array('category-name1', 'category-name2', 'category-name3'))): // Hide prices remove_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10); // Hide add-to-cart buttons remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart'); endif; } /** * Hide prices and cart buttons on single product pages */ add_action('woocommerce_single_product_summary', 'cc_hide_single_product_prices', 1); function cc_hide_single_product_prices(){ global $product; if( has_term(array(category-name1', 'category-name2', 'category-name3'), 'product_cat', $product->get_id())): // Hide prices remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10); // Hide add-to-cart buttons remove_action('woocommerce_single_product_summary','woocommerce_template_single_add_to_cart', 30); endif; }