WooCommerce Code Reference


WC Shipping Zone Data Store Interface.

Functions that must be defined by shipping zone store classes.


Table of Contents

add_method()  : int
Add a shipping method to a zone.
delete_method()  : mixed
Delete a method instance.
get_method()  : object
Get a shipping zone method instance.
get_method_count()  : int
Get count of methods for a zone.
get_methods()  : array<string|int, mixed>
Get a list of shipping methods for a specific zone.
get_zone_id_by_instance_id()  : int
Return a zone ID from an instance ID.
get_zone_id_from_package()  : int
Find a matching zone ID for a given package.
get_zones()  : array<string|int, mixed>
Return an ordered list of zones.



Get a list of shipping methods for a specific zone.

public get_methods(int $zone_id, bool $enabled_only) : array<string|int, mixed>
$zone_id : int

Zone ID.

$enabled_only : bool

True to request enabled methods only.

Return values
array<string|int, mixed>Array of objects containing method_id, method_order, instance_id, is_enabled