PHP Class WC_Shipping_Zones

Since: 2.6.0
Author: WooThemes
ファイルを表示 Open project: woocommerce/woocommerce Class Usage Examples

Public Methods

Method Description
delete_zone ( integer $zone_id ) Delete a zone using it's ID
get_shipping_method ( $instance_id ) : WC_Shipping_Meethod | boolean Get shipping zone using it's ID
get_zone ( integer $zone_id ) : WC_Shipping_Zone | boolean Get shipping zone using it's ID
get_zone_by ( string $by = 'zone_id', integer $id ) : WC_Shipping_Zone | boolean Get shipping zone by an ID.
get_zone_matching_package ( object $package ) : WC_Shipping_Zone Find a matching zone for a given package.
get_zones ( ) : array Get shipping zones from the database

Method Details

delete_zone() public static method

Delete a zone using it's ID
Since: 2.6.0
public static delete_zone ( integer $zone_id )
$zone_id integer

get_shipping_method() public static method

Get shipping zone using it's ID
Since: 2.6.0
public static get_shipping_method ( $instance_id ) : WC_Shipping_Meethod | boolean
return WC_Shipping_Meethod | boolean

get_zone() public static method

Get shipping zone using it's ID
Since: 2.6.0
public static get_zone ( integer $zone_id ) : WC_Shipping_Zone | boolean
$zone_id integer
return WC_Shipping_Zone | boolean

get_zone_by() public static method

Get shipping zone by an ID.
Since: 2.6.0
public static get_zone_by ( string $by = 'zone_id', integer $id ) : WC_Shipping_Zone | boolean
$by string zone_id or instance_id
$id integer
return WC_Shipping_Zone | boolean

get_zone_matching_package() public static method

Find a matching zone for a given package.
Since: 2.6.0
public static get_zone_matching_package ( object $package ) : WC_Shipping_Zone
$package object
return WC_Shipping_Zone

get_zones() public static method

Get shipping zones from the database
Since: 2.6.0
public static get_zones ( ) : array
return array of arrays