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.

Method of the class: WC_Shipping_Free_Shipping{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Shipping_Free_Shipping = new WC_Shipping_Free_Shipping();
$WC_Shipping_Free_Shipping->calculate_shipping( $package );
$package(array)
Shipping package.
Default: array()

WC_Shipping_Free_Shipping::calculate_shipping() code WC 9.4.2

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