After the upgrade to Woocommerce 2.6 , I decided to use the new Shipping Zones functionality I have broken a function of mine calculating the difference from cart value in order to get free shipping.
I used to get the free shipping value like :
$shipping_methods = $woocommerce->shipping->load_shipping_methods();
$free_shipping = $shipping_methods['free_shipping'];
$cart_total = $woocommerce->cart->cart_contents_total;
$minimum_amount_required = floatval($free_shipping->min_amount);
$diff = $minimum_amount_required - $cart_total;
But now as things have changes , i want to use shipping zones. So how can I get the min amount required for free shipping? I've already set the values from the options and I have tried
$shipping = new WC_Shipping_Free_Shipping();
Which returns
object(WC_Shipping_Free_Shipping)#9235 (22) {
["min_amount"]=>
string(1) "0"
["requires"]=>
string(0) ""
["supports"]=>
array(3) {
[0]=>
string(14) "shipping-zones"
[1]=>
string(17) "instance-settings"
[2]=>
string(23) "instance-settings-modal"
}......
Although I have set an amount at settings and it returns 0.