WordPress at Your Fingertips
function is not described

WC_Cart_Totals::get_total() public WC 3.2.0

Get a single total with or without precision (in cents).

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

No Hooks.

Return

Int|float.

Usage

$WC_Cart_Totals = new WC_Cart_Totals();
$WC_Cart_Totals->get_total( $key, $in_cents );
$key(string)
Total to get.
Default: 'total'
$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_total() WC 5.9.0

public function get_total( $key = 'total', $in_cents = false ) {
	$totals = $this->get_totals( $in_cents );
	return isset( $totals[ $key ] ) ? $totals[ $key ] : 0;
}