WooCommerce Code Reference

WC_Shipping_Zones
in package

Shipping zones class.

Table of Contents

delete_zone()  : mixed
Delete a zone using it's ID
get_shipping_method()  : bool|WC_Shipping_Method
Get shipping zone using it's ID.
get_zone()  : WC_Shipping_Zone|bool
Get shipping zone using it's ID
get_zone_by()  : WC_Shipping_Zone|bool
Get shipping zone by an ID.
get_zone_matching_package()  : WC_Shipping_Zone
Find a matching zone for a given package.
get_zones()  : array<string|int, mixed>
Get shipping zones from the database.

Methods

delete_zone()

Delete a zone using it's ID

public static delete_zone(int $zone_id) : mixed
Parameters
$zone_id : int

Zone ID.

Tags
since
2.6.0
Return values
mixed

get_zones()

Get shipping zones from the database.

public static get_zones([string $context = 'admin' ]) : array<string|int, mixed>
Parameters
$context : string = 'admin'

Getting shipping methods for what context. Valid values, admin, json.

Tags
since
2.6.0
Return values
array<string|int, mixed>Array of arrays.