These 2 filters allow you to get the minimum order amount or even to change its value:
woocommerce_shipping_free_shipping_instance_option
woocommerce_shipping_free_shipping_option
You could use it like this for example:
add_filter( 'woocommerce_shipping_free_shipping_instance_option', 'get_free_shipping_min_amount', 10, 3 );
add_filter( 'woocommerce_shipping_free_shipping_option', 'get_free_shipping_min_amount', 10, 3 );
function get_free_shipping_min_amount( $option, $key, $method ){
if (
'min_amount' !== $key ||
! is_numeric( $option )
) {
return $option;
}
// Minimum amount
$min_amount = $option;
return $option;
}
You can get more info from the shipping method using the $method
param like instance_id or something like that if you wish.
You can also replace 'free_shipping' from the hook to get info from other shipping methods. The hook works like this:
'woocommerce_shipping_' . $shipping_method_id . '_option'
.
You can take a look at it on the documentation: