WordPress at Your Fingertips
function is not described

WC_Cart::calculate_totals() public WC 1.0

Calculate totals for the items in the cart.

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

Return

null. Nothing.

Usage

$WC_Cart = new WC_Cart();
$WC_Cart->calculate_totals();

Code of WC_Cart::calculate_totals() WC 5.6.0

public function calculate_totals() {
	$this->reset_totals();

	if ( $this->is_empty() ) {
		$this->session->set_session();
		return;
	}

	do_action( 'woocommerce_before_calculate_totals', $this );

	new WC_Cart_Totals( $this );

	do_action( 'woocommerce_after_calculate_totals', $this );
}