WC_Abstract_Order::set_total()publicWC 1.0

Set total.

Method of the class: WC_Abstract_Order{}

No Hooks.

Return

true|false|null.

Usage

$WC_Abstract_Order = new WC_Abstract_Order();
$WC_Abstract_Order->set_total( $value, $deprecated );
$value(string) (required)
Value to set.
$deprecated(string)
Function used to set different totals based on this.
Default: ''

WC_Abstract_Order::set_total() code WC 8.7.0

public function set_total( $value, $deprecated = '' ) {
	if ( $deprecated ) {
		wc_deprecated_argument( 'total_type', '3.0', 'Use dedicated total setter methods instead.' );
		return $this->legacy_set_total( $value, $deprecated );
	}
	$this->set_prop( 'total', wc_format_decimal( $value, wc_get_price_decimals() ) );
}