WC_Shipping_Method::get_rates_for_package()
Return calculated rates for a package.
Method of the class: WC_Shipping_Method{}
No Hooks.
Return
Array
.
Usage
$WC_Shipping_Method = new WC_Shipping_Method(); $WC_Shipping_Method->get_rates_for_package( $package );
- $package(array) (required)
- Package array.
Changelog
Since 2.6.0 | Introduced. |
WC_Shipping_Method::get_rates_for_package() WC Shipping Method::get rates for package code WC 9.7.1
public function get_rates_for_package( $package ) { $this->rates = array(); if ( $this->is_available( $package ) && ( empty( $package['ship_via'] ) || in_array( $this->id, $package['ship_via'] ) ) ) { $this->calculate_shipping( $package ); } return $this->rates; }