WC_Abstract_Order::get_cart_subtotal_for_order()protectedWC 1.0

Helper function. If you add all items in this order in cart again, this would be the cart subtotal (assuming all other settings are same).

Method of the class: WC_Abstract_Order{}

No Hooks.

Return

float. Cart subtotal.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_cart_subtotal_for_order();

WC_Abstract_Order::get_cart_subtotal_for_order() code WC 8.7.0

protected function get_cart_subtotal_for_order() {
	return wc_remove_number_precision(
		$this->get_rounded_items_total(
			$this->get_values_for_total( 'subtotal' )
		)
	);
}