WC_Shipping_Legacy_Free_Shipping::calculate_shipping()publicWC 1.0

Calculate shipping.

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

Хуков нет.

Возвращает

null. Ничего.

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

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

Код WC_Shipping_Legacy_Free_Shipping::calculate_shipping() WC 7.3.0

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