// ========================================================================= // MINIMUM ORDER AMOUNT FOR SPECIFIC SHIPPING METHOD // ========================================================================= function minimum_order_amount_for_shipping( $rates, $package ) { $threshold = 100; if ( WC()->cart->subtotal < $threshold ) { unset( $rates['flat_rate:2'] ); } return $rates; } add_filter( 'woocommerce_package_rates', 'minimum_order_amount_for_shipping', 10, 2 );
Leave a Reply