WC_Shipping_Method::get_rates_for_package
Return calculated rates for a package.
Метод класса: WC_Shipping_Method{}
Хуков нет.
Возвращает
Массив.
Использование
$WC_Shipping_Method = new WC_Shipping_Method(); $WC_Shipping_Method->get_rates_for_package( $package );
- $package(массив) (обязательный)
- Package array.
Список изменений
| С версии 2.6.0 | Введена. |
Код WC_Shipping_Method::get_rates_for_package() WC Shipping Method::get rates for package WC 10.4.3
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;
}