WordPress at Your Fingertips
function is not described

WC_Cart_Totals::get_totals() public WC 3.2.0

Get all totals with or without precision (in cents).

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

No Hooks.

Return

Array..

Usage

$WC_Cart_Totals = new WC_Cart_Totals();
$WC_Cart_Totals->get_totals( $in_cents );
$in_cents(true|false)
Should the totals be returned in cents, or without precision.
Default: false

Changelog

Since 3.2.0 Introduced.

Code of WC_Cart_Totals::get_totals() WC 5.9.0

public function get_totals( $in_cents = false ) {
	return $in_cents ? $this->totals : wc_remove_number_precision_deep( $this->totals );
}