WC_API_Orders::get_order_subtotal()
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 8.7.0
private function get_order_subtotal( $order ) { $subtotal = 0; // subtotal foreach ( $order->get_items() as $item ) { $subtotal += $item->get_subtotal(); } return $subtotal; }