Automattic\WooCommerce\Gateways\PayPal

Request::get_paypal_order_items_subtotal │ private │ WC 1.0

Get the subtotal for all items, before discounts.

Метод класса: Request{}

Хуков нет.

Возвращает

float.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_paypal_order_items_subtotal( $order ): float;
$order(WC_Order) (обязательный)
Order object.

Код Request::get_paypal_order_items_subtotal() WC 11.2.2

private function get_paypal_order_items_subtotal( WC_Order $order ): float {
	$total = 0;
	foreach ( $order->get_items( array( OrderItemType::LINE_ITEM, OrderItemType::FEE ) ) as $item ) {
		$total += wc_add_number_precision( $this->get_paypal_order_item_amount( $order, $item ) * $item->get_quantity(), false );
	}

	return wc_remove_number_precision( $total );
}