WooCommerce Code Reference

WC_Shipping_Zone_Data_Store_Interface

WC Shipping Zone Data Store Interface.

Functions that must be defined by shipping zone store classes.

Tags
version
3.0.0

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.

Methods

get_methods()

Get a list of shipping methods for a specific zone.

public get_methods(int $zone_id, bool $enabled_only) : array<string|int, mixed>
Parameters
$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