<?php
add_filter('woocommerce_package_rates','xmit_subtotal_based_tiered_shipping', 10, 2 );
function xmit_subtotal_based_tiered_shipping( $rates, $package ){
/* set the subtotal amounts to be reached for each shipping tier */
$threshold1 = 50;
$threshold2 = 100;
$subtotal = WC()->cart->subtotal;
if ( $subtotal < $threshold1 )
{ // Below 50 ('flat_rate:4' is enabled)
unset( $rates['flat_rate:7'] );
unset( $rates['flat_rate:9'] );
}
elseif ( $subtotal >= $threshold1 && $subtotal < $threshold2 )
{ // Starting from 50 and below 100 ('flat_rate:7' is enabled)
unset( $rates['flat_rate:4'] );
unset( $rates['flat_rate:9'] );
}
elseif ( $subtotal >= $threshold2 )
{ // Starting from 100 and up ('flat_rate:9' is enabled)
unset( $rates['flat_rate:4'] );
unset( $rates['flat_rate:7'] );
}
return $rates;
}
In Woocommerce -> Settings -> Shipping, set up a Shipping Zone for Standard Shipping.
Add Shipping methods, in this case three: Standard Shipping ($7), Discounted Shipping ($5), and Free Shipping ($0).
Add the PHP to functions.php. To find out the id # of the rates, inspect the shipping methods in your browser;
the data-id of the table row for each is what has to go into the 'flat_rate:x' string.