WC_Cart::get_totals_var()protectedWC 3.2.0

Get a total.

Method of the class: WC_Cart{}

No Hooks.

Returns

Mixed.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_totals_var( $key );
$key(string) (required)
Key of element in $totals array.

Changelog

Since 3.2.0 Introduced.

WC_Cart::get_totals_var() code WC 9.8.5

protected function get_totals_var( $key ) {
	return isset( $this->totals[ $key ] ) ? $this->totals[ $key ] : $this->default_totals[ $key ];
}