I have create two shipping zone, A zone is shipping cost by zone with 6 State and B zone is shipping cost by distance for other
and the code below it work for shipping price based on cart subtotal
function sl_cc_adjust_distance_range_shipping_cost($shipping_cost, $package, $wc_instance, $range_data){
$start_range = (int) $range_data['start_range'];
$end_range = (int) $range_data['end_range'];
$distance = $range_data['distance'];
$cart = $wc_instance->cart->get_subtotal();
if($start_range === 60 && $end_range === 100 && $cart > 2000){
return $distance * 1.5;
}
return $shipping_cost;
}
add_filter('kikote_distance_range_shipping_cost', 'sl_cc_adjust_distance_range_shipping_cost', 10, 4);
but I want to make if vistor is select State and if it is consistent then get shipping cost from A and B depend on they select location. I using google map autocomplete input for select location.