WordPress at Your Fingertips
function is not described

WC_Gateway_Paypal_Request::get_order_item_names() protected WC 1.0

Get order item names as a string.

{} It's a method of the class: WC_Gateway_Paypal_Request{}

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_order_item_names( $order );
$order(WC_Order) (required)
Order object.

Code of WC_Gateway_Paypal_Request::get_order_item_names() WC 5.6.0

protected function get_order_item_names( $order ) {
	$item_names = array();

	foreach ( $order->get_items() as $item ) {
		$item_name = $item->get_name();
		$item_meta = wp_strip_all_tags(
			wc_display_item_meta(
				$item,
				array(
					'before'    => '',
					'separator' => ', ',
					'after'     => '',
					'echo'      => false,
					'autop'     => false,
				)
			)
		);

		if ( $item_meta ) {
			$item_name .= ' (' . $item_meta . ')';
		}

		$item_names[] = $item_name . ' x ' . $item->get_quantity();
	}

	return apply_filters( 'woocommerce_paypal_get_order_item_names', implode( ', ', $item_names ), $order );
}