WC_API_Orders::get_order_subtotal() private WC 2.1
Helper method to get the order subtotal
{} It's a method of the class: WC_API_Orders{}
No Hooks.
Return
float.
Usage
// private - for code of main (parent) class only $result = $this->get_order_subtotal( $order );
- $order(WC_Order) (required)
- -
Changelog
Since 2.1 | Introduced. |
Code of WC_API_Orders::get_order_subtotal() WC API Orders::get order subtotal WC 5.0.0
private function get_order_subtotal( $order ) {
$subtotal = 0;
// subtotal
foreach ( $order->get_items() as $item ) {
$subtotal += $item->get_subtotal();
}
return $subtotal;
}