WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Cart_Totals::calculate_totals() WC 3.2.0

Main cart totals.

Это метод класса: WC_Cart_Totals

Возвращает

Null. Ничего.

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

$WC_Cart_Totals = new WC_Cart_Totals();
$var = $WC_Cart_Totals->calculate_totals();

Список изменений

С версии 3.2.0 Введена.

Код WC Cart Totals::calculate totals: woocommerce/includes/class-wc-cart-totals.php WC 3.7.1

<?php
protected function calculate_totals() {
	$this->set_total( 'total', round( $this->get_total( 'items_total', true ) + $this->get_total( 'fees_total', true ) + $this->get_total( 'shipping_total', true ) + array_sum( $this->get_merged_taxes( true ) ), 0 ) );
	$this->cart->set_total_tax( array_sum( $this->get_merged_taxes( false ) ) );

	// Allow plugins to hook and alter totals before final total is calculated.
	if ( has_action( 'woocommerce_calculate_totals' ) ) {
		do_action( 'woocommerce_calculate_totals', $this->cart );
	}

	// Allow plugins to filter the grand total, and sum the cart totals in case of modifications.
	$this->cart->set_total( max( 0, apply_filters( 'woocommerce_calculated_total', $this->get_total( 'total' ), $this->cart ) ) );
}