WooCommerce Code Reference

WC_Shipping_Zone_Data_Store_Interface

Shipping Zone Data Store Interface

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
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
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
Parameters
$zone_id : int

Zone ID.

$enabled_only : bool

True to request enabled methods only.

Return values
arrayArray of objects containing method_id, method_order, instance_id, is_enabled