WC_Cart_Totals::set_total
Set a single total.
Method of the class: WC_Cart_Totals{}
No Hooks.
Returns
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() WC Cart Totals::set total code WC 10.3.6
protected function set_total( $key, $total ) {
$this->totals[ $key ] = $total;
}