WC_Shipping_Free_Shipping::calculate_shipping()publicWC 1.0

Called to calculate shipping rates for this method. Rates can be added using the add_rate() method.

Метод класса: WC_Shipping_Free_Shipping{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$WC_Shipping_Free_Shipping = new WC_Shipping_Free_Shipping();
$WC_Shipping_Free_Shipping->calculate_shipping( $package );
$package(массив)
Shipping package.
По умолчанию: array()

Код WC_Shipping_Free_Shipping::calculate_shipping() WC 7.3.0

public function calculate_shipping( $package = array() ) {
	$this->add_rate(
		array(
			'label'   => $this->title,
			'cost'    => 0,
			'taxes'   => false,
			'package' => $package,
		)
	);
}