WC_Cart::set_subtotal()publicWC 3.2.0

Set subtotal.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Cart = new WC_Cart();
$WC_Cart->set_subtotal( $value );
$value(string) (required)
Value to set.

Changelog

Since 3.2.0 Introduced.

Code of WC_Cart::set_subtotal() WC 6.7.0

public function set_subtotal( $value ) {
	$this->totals['subtotal'] = wc_format_decimal( $value );
}