WC_Shipping_Method::get_rates_for_package()publicWC 2.6.0

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 9.4.2

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;
}