Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Wyłączenie metod wysyłki w zależności od sumy

add_filter( 'woocommerce_package_rates', 'wylaczenie_wybranych_wysylek', 10, 2);
function wylaczenie_wybranych_wysylek( $rates, $package ) {
	$cart_subtotal = $package['contents_cost'];
	if ( $cart_subtotal < 200 ) {
		unset( $rates['flat_rate:2'] );
		unset( $rates['flat_rate:3'] );
	}
	else {
		unset( $rates['flat_rate:6'] );
	}
	return $rates;
}