WordPress at Your Fingertips
function is not described

WC_Cart_Totals::set_total() protected WC 3.2.0

Set a single total.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->set_total( $key, $total );
$key(string) (required)
Total name you want to set.
$total(int) (required)
Total to set.

Changelog

Since 3.2.0 Introduced.

Code of WC_Cart_Totals::set_total() WC 5.9.0

protected function set_total( $key, $total ) {
	$this->totals[ $key ] = $total;
}