Automattic\WooCommerce\Internal\RestApi\Routes\V4\ShippingZones

ShippingZoneSchema::get_item_responsepublicWC 1.0

Get the item response.

Method of the class: ShippingZoneSchema{}

No Hooks.

Returns

Array. The item response.

Usage

$ShippingZoneSchema = new ShippingZoneSchema();
$ShippingZoneSchema->get_item_response( $zone, $request, $include_fields ): array;
$zone(WC_Shipping_Zone) (required)
WordPress representation of the zone.
$request(WP_REST_Request) (required)
Request object.
$include_fields(array)
Fields to include in the response.
Default: array()

ShippingZoneSchema::get_item_response() code WC 10.4.3

public function get_item_response( $zone, WP_REST_Request $request, array $include_fields = array() ): array {
	return array(
		'id'        => $zone->get_id(),
		'name'      => $zone->get_zone_name(),
		'order'     => $zone->get_zone_order(),
		'locations' => $this->get_formatted_zone_locations( $zone ),
		'methods'   => $this->get_formatted_zone_methods( $zone ),
	);
}