WC_Gateway_Paypal_Request::prepare_line_items()
Get line items to send to paypal.
Метод класса: WC_Gateway_Paypal_Request{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->prepare_line_items( $order );
- $order(WC_Order) (обязательный)
- Order object.
Код WC_Gateway_Paypal_Request::prepare_line_items() WC Gateway Paypal Request::prepare line items WC 8.7.0
protected function prepare_line_items( $order ) { $this->delete_line_items(); // Products. foreach ( $order->get_items( array( 'line_item', 'fee' ) ) as $item ) { if ( 'fee' === $item['type'] ) { $item_line_total = $this->number_format( $item['line_total'], $order ); $this->add_line_item( $item->get_name(), 1, $item_line_total ); } else { $product = $item->get_product(); $sku = $product ? $product->get_sku() : ''; $item_line_total = $this->number_format( $order->get_item_subtotal( $item, false ), $order ); $this->add_line_item( $this->get_order_item_name( $order, $item ), $item->get_quantity(), $item_line_total, $sku ); } } }