Свойство | Type | Description | |
---|---|---|---|
$enabled | True if shipping is enabled. | ||
$packages | Stores packages to ship and to get quotes for. | ||
$shipping_classes | Stores the shipping classes. | ||
$shipping_methods | Stores methods loaded into woocommerce. | ||
$shipping_taxes | Stores an array of shipping taxes. | ||
$shipping_total | Stores the cost of shipping |
Свойство | Type | Description | |
---|---|---|---|
$_instance | The single instance of the class |
Méthode | Description | |
---|---|---|
__clone ( ) | Cloning is forbidden. | |
__construct ( ) | Initialize shipping. | |
__wakeup ( ) | Unserializing instances of this class is forbidden. | |
calculate_shipping ( array $packages = [] ) | Calculate shipping for (multiple) packages of cart items. | |
calculate_shipping_for_package ( array $package = [], integer $package_key ) : array | Calculate shipping rates for a package, | |
get_packages ( ) : array | Get packages. | |
get_shipping_classes ( ) : array | Get an array of shipping classes. | |
get_shipping_method_class_names ( ) : array | Shipping methods register themselves by returning their main class name through the woocommerce_shipping_methods filter. | |
get_shipping_methods ( ) : array | Returns all registered shipping methods for usage. | |
init ( ) | Initialize shipping. | |
instance ( ) : WC_Shipping | Main WC_Shipping Instance. | |
load_shipping_methods ( array $package = [] ) : array | Loads all shipping methods which are hooked in. If a $package is passed some methods may add themselves conditionally. | |
register_shipping_method ( object | string $method ) | Register a shipping method. | |
reset_shipping ( ) | Reset shipping. | |
sort_shipping_methods ( ) | ||
unregister_shipping_methods ( ) | Unregister shipping methods. |
Méthode | Description | |
---|---|---|
is_package_shippable ( array $package ) : boolean | See if package is shippable. |
Méthode | Description | |
---|---|---|
get_default_method ( array $available_methods, boolean $current_chosen_method = false ) : string | Get the default method. |
public calculate_shipping ( array $packages = [] ) | ||
$packages | array | multi-dimensional array of cart items to calc shipping for |
public get_shipping_classes ( ) : array | ||
Résultat | array |
public get_shipping_method_class_names ( ) : array | ||
Résultat | array |
public get_shipping_methods ( ) : array | ||
Résultat | array |
public static instance ( ) : WC_Shipping | ||
Résultat | WC_Shipping | Main instance |
protected is_package_shippable ( array $package ) : boolean | ||
$package | array | |
Résultat | boolean |
public load_shipping_methods ( array $package = [] ) : array | ||
$package | array | |
Résultat | array |
public register_shipping_method ( object | string $method ) | ||
$method | object | string | Either the name of the method's class, or an instance of the method's class. |
public unregister_shipping_methods ( ) |
protected static $_instance |
public $shipping_methods |