getShippingZoneLocations method
Returns a list of all WooShippingZoneLocation.
Related endpoint: https://woocommerce.github.io/woocommerce-rest-api-docs/#shipping-zone-locations.
Implementation
Future<List<WooShippingZoneLocation>> getShippingZoneLocations(
{required int shippingZoneId}) async {
List<WooShippingZoneLocation> shippingZoneLocations = [];
_setApiResourceUrl(
path: 'shipping/zones/' + shippingZoneId.toString() + '/locations');
final response = await get(queryUri.toString());
for (var l in response) {
var sZoneLocation = WooShippingZoneLocation.fromJson(l);
_printToLog(
'shipping zone locations gotten here : ' + sZoneLocation.toString());
shippingZoneLocations.add(sZoneLocation);
}
return shippingZoneLocations;
}