Wc_Tokens::get_woo_product_image_urls_from_items( WC_Order $order,  $value_to_match )


Parameters Parameters

$order

(Required)

$value_to_match

(Required)


Top ↑

Return Return

(string)


Source Source

File: src/integrations/woocommerce/tokens/wc-tokens.php

	public function get_woo_product_image_urls_from_items( $order, $value_to_match ) {
		$items       = $order->get_items();
		$product_image_urls = array();
		if ( $items ) {
			/** @var WC_Order_Item_Product $item */
			foreach ( $items as $item ) {
				if ( absint( $value_to_match ) === absint( $item->get_product_id() ) || absint( '-1' ) === absint( $value_to_match ) ) {
					$product_image_urls[] = get_the_post_thumbnail_url( $item->get_product_id(), 'full' );
				}
			}
		}

		return join( ', ', $product_image_urls );
	}