WC_Cart::calculate_totals()publicWC 1.0

Calculate totals for the items in the cart.

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

Возвращает

null. Ничего (null).

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

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

Код WC_Cart::calculate_totals() WC 8.7.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 );
}