Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

WC_API_Orders::get_order_subtotal( WC_Order $order )

Helper method to get the order subtotal


Description Description


Parameters Parameters

$order

(Required)


Top ↑

Return Return

(float)


Top ↑

Source Source

File: includes/legacy/api/v1/class-wc-api-orders.php

	private function get_order_subtotal( $order ) {
		$subtotal = 0;

		// subtotal
		foreach ( $order->get_items() as $item ) {
			$subtotal += $item->get_subtotal();
		}

		return $subtotal;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.1 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.