WordPress at a glance
function is not described

wc_format_list_of_items() WC 1.0

Comma separate a list of item names, and replace final comma with 'and'.

No Hooks.

Return

String. Nothing.

Usage

wc_format_list_of_items( $items );
$items(array) (required)
Cart items.

Code of wc_format_list_of_items() WC 5.3.0

<?php
function wc_format_list_of_items( $items ) {
	$item_string = '';

	foreach ( $items as $key => $item ) {
		$item_string .= $item;

		if ( count( $items ) === $key + 2 ) {
			$item_string .= ' ' . __( 'and', 'woocommerce' ) . ' ';
		} elseif ( count( $items ) !== $key + 1 ) {
			$item_string .= ', ';
		}
	}

	return $item_string;
}