WC_Cart_Totals::get_totals()publicWC 3.2.0

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

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.

WC_Cart_Totals::get_totals() code WC 8.7.0

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