WordPress at Your Fingertips
function is not described

WC_Order_Item_Product::set_total() public WC 1.0

Line total (after 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_total( $value );
$value(string) (required)
Total.

Code of WC_Order_Item_Product::set_total() WC 5.7.0

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

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

	$this->set_prop( 'total', $value );

	// Subtotal cannot be less than total.
	if ( '' === $this->get_subtotal() || $this->get_subtotal() < $this->get_total() ) {
		$this->set_subtotal( $value );
	}
}