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)
Return Return
(float)
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; }
Changelog Changelog
Version | Description |
---|---|
2.1 | Introduced. |