woocommerce_get_product_thumbnail()WC 1.0

Get the product thumbnail, or the placeholder if not set.

Hooks from the function

Return

String.

Usage

woocommerce_get_product_thumbnail( $size, $attr, $placeholder );
$size(string)
(default: 'woocommerce_thumbnail').
Default: 'woocommerce_thumbnail'
$attr(array)
Image attributes.
Default: array()
$placeholder(true|false)
True to return $placeholder if no image is found, or false to return an empty string.
Default: true

Code of woocommerce_get_product_thumbnail() WC 6.8.2

function woocommerce_get_product_thumbnail( $size = 'woocommerce_thumbnail', $attr = array(), $placeholder = true ) {
	global $product;

	if ( ! is_array( $attr ) ) {
		$attr = array();
	}

	if ( ! is_bool( $placeholder ) ) {
		$placeholder = true;
	}

	$image_size = apply_filters( 'single_product_archive_thumbnail_size', $size );

	return $product ? $product->get_image( $image_size, $attr, $placeholder ) : '';
}