WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Routes

AbstractCartRoute::calculate_totals() protected WC 1.0

Ensures the cart totals are calculated before an API response is generated.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->calculate_totals();

Code of AbstractCartRoute::calculate_totals() WC 5.8.0

protected function calculate_totals() {
	wc()->cart->get_cart();
	wc()->cart->calculate_fees();
	wc()->cart->calculate_shipping();
	wc()->cart->calculate_totals();
}