PHP Interface WC_Shipping_Zone_Data_Store_Interface

Functions that must be defined by shipping zone store classes.
Author: WooCommerce
Show file Open project: woocommerce/woocommerce

Public Methods

Method Description
add_method ( integer $zone_id, string $type, integer $order ) : integer Add a shipping method to a zone.
delete_method ( integer $instance_id ) Delete a method instance.
get_method ( $instance_id ) : object Get a shipping zone method instance.
get_method_count ( $zone_id ) : integer Get count of methods for a zone.
get_methods ( integer $zone_id, boolean $enabled_only ) : array Get a list of shipping methods for a specific zone.
get_zone_id_by_instance_id ( $id ) : integer Return a zone ID from an instance ID.
get_zone_id_from_package ( object $package ) : integer Find a matching zone ID for a given package.
get_zones ( ) : array Return an ordered list of zones.

Method Details

add_method() public method

Add a shipping method to a zone.
public add_method ( integer $zone_id, string $type, integer $order ) : integer
$zone_id integer Zone ID
$type string Method Type/ID
$order integer Method Order
return integer Instance ID

delete_method() public method

Delete a method instance.
public delete_method ( integer $instance_id )
$instance_id integer

get_method() public method

Get a shipping zone method instance.
public get_method ( $instance_id ) : object
return object

get_method_count() public method

Get count of methods for a zone.
public get_method_count ( $zone_id ) : integer
return integer Method Count

get_methods() public method

Get a list of shipping methods for a specific zone.
public get_methods ( integer $zone_id, boolean $enabled_only ) : array
$zone_id integer Zone ID
$enabled_only boolean True to request enabled methods only.
return array Array of objects containing method_id, method_order, instance_id, is_enabled

get_zone_id_by_instance_id() public method

Return a zone ID from an instance ID.
public get_zone_id_by_instance_id ( $id ) : integer
return integer

get_zone_id_from_package() public method

Find a matching zone ID for a given package.
public get_zone_id_from_package ( object $package ) : integer
$package object
return integer

get_zones() public method

Return an ordered list of zones.
public get_zones ( ) : array
return array An array of objects containing a zone_id, zone_name, and zone_order.