WordPress at Your Fingertips
function is not described

WC_Abstract_Order::calculate_shipping() public WC 2.2

Calculate shipping total.

{} It's a method of the class: WC_Abstract_Order{}

No Hooks.

Return

float.

Usage

$WC_Abstract_Order = new WC_Abstract_Order();
$WC_Abstract_Order->calculate_shipping();

Changelog

Since 2.2 Introduced.

Code of WC_Abstract_Order::calculate_shipping() WC 5.8.0

public function calculate_shipping() {
	$shipping_total = 0;

	foreach ( $this->get_shipping_methods() as $shipping ) {
		$shipping_total += $shipping->get_total();
	}

	$this->set_shipping_total( $shipping_total );
	$this->save();

	return $this->get_shipping_total();
}