WC_Cart_Totals::set_total()protectedWC 3.2.0

Set a single total.

Method of the class: WC_Cart_Totals{}

No Hooks.

Return

null. Nothing (null).

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.

WC_Cart_Totals::set_total() code WC 8.6.1

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