WC_Shipping_Zone_Data_Store_Interface
in
WC Shipping Zone Data Store Interface.
Functions that must be defined by shipping zone store classes.
Tags
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
add_method()
Add a shipping method to a zone.
public
add_method(int $zone_id, string $type, int $order) : int
Parameters
- $zone_id : int
-
Zone ID.
- $type : string
-
Method Type/ID.
- $order : int
-
Method Order ID.
Return values
int — Instance IDdelete_method()
Delete a method instance.
public
delete_method(int $instance_id) : mixed
Parameters
- $instance_id : int
-
Instance ID.
Return values
mixed —get_method()
Get a shipping zone method instance.
public
get_method(int $instance_id) : object
Parameters
- $instance_id : int
-
Instance ID.
Return values
object —get_method_count()
Get count of methods for a zone.
public
get_method_count(int $zone_id) : int
Parameters
- $zone_id : int
-
Zone ID.
Return values
int — Method Countget_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_enabledget_zone_id_by_instance_id()
Return a zone ID from an instance ID.
public
get_zone_id_by_instance_id(int $id) : int
Parameters
- $id : int
-
Instance ID.
Return values
int —get_zone_id_from_package()
Find a matching zone ID for a given package.
public
get_zone_id_from_package(object $package) : int
Parameters
- $package : object
-
Zone package object.
Return values
int —get_zones()
Return an ordered list of zones.
public
get_zones() : array<string|int, mixed>