WordPress at Your Fingertips
function is not described

WC_Order_Item_Product::set_subtotal() public WC 1.0

Line subtotal (before discounts).

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Order_Item_Product = new WC_Order_Item_Product();
$WC_Order_Item_Product->set_subtotal( $value );
$value(string) (required)
Subtotal.

Code of WC_Order_Item_Product::set_subtotal() WC 5.6.0

public function set_subtotal( $value ) {
	$value = wc_format_decimal( $value );

	if ( ! is_numeric( $value ) ) {
		$value = 0;
	}

	$this->set_prop( 'subtotal', $value );
}