WC_API_Orders::get_order_subtotal() private WC 2.1
Helper method to get the order subtotal
{} Это метод класса: WC_API_Orders{}
Хуков нет.
Возвращает
float.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_order_subtotal( $order );
- $order(WC_Order) (обязательный)
- -
Список изменений
С версии 2.1 | Введена. |
Код 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;
}