Automattic\WooCommerce\Blocks\BlockTypes\OrderConfirmation

Totals::render_order_details_table_items()protectedWC 1.0

Render order details table items.

Loosely based on the templates order-details.php and order-details-item.php from core.

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

Возвращает

Строку.

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

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

Код Totals::render_order_details_table_items() WC 9.8.5

protected function render_order_details_table_items( $order ) {
	$return      = '';
	$order_items = array_filter(
	// phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
		$order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) ),
		function( $item ) {
                // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
			return apply_filters( 'woocommerce_order_item_visible', true, $item );
		}
	);

	foreach ( $order_items as $item_id => $item ) {
		$product = $item->get_product();
		$return .= $this->render_order_details_table_item( $order, $item_id, $item, $product );
	}

	return $return;
}