Hide some shipping rates based on taxonomy terms in WooCommerce 4.8+
问题 I use this to unset shipping for product with specific tag: function specific_products_shipping_methods( $rates, $package ){ // etiquette cocolis $terms = array( 'cocolis' ); $taxonomy = 'product_tag'; foreach( $package['contents'] as $cart_item ) { if ( has_term( $terms, $taxonomy, $cart_item['product_id'] ) ) { unset( $rates['oik_weight_zone_shipping_49'] ); unset( $rates['chrono10'] ); unset( $rates['chrono13'] ); add_filter('woocommerce_shipping_chosen_method', 'reset_default_shipping