Automattic\WooCommerce\StoreApi\Utilities

CartController::calculate_totalspublicWC 9.2.0

Recalculates the cart totals and returns the updated cart instance.

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

Хуков нет.

Возвращает

\WC_Cart.

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

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

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

С версии 9.2.0 Введена.
С версии 9.2.0 Calculate shipping was removed here because it's called already by calculate_totals.

Код CartController::calculate_totals() WC 10.5.2

public function calculate_totals() {
	$cart = $this->get_cart_instance();
	$cart->get_cart();
	$cart->calculate_fees();
	$cart->calculate_totals();
	return $cart;
}