[**@wocart/storefront v3.1.0**](../../README)

***

[@wocart/storefront](../../README) / [index](../README) / productImageSource

# Function: productImageSource()

> **productImageSource**(`product`): `string`

The product's representative image URL, or `null` when it has none.

Prefers the merchant's chosen cover, falls back to the first usable gallery
image, and treats a blank `url` as no image at all — so a caller renders its
placeholder exactly when the product genuinely has no photograph.

## Parameters

### product

[`ProductImageSourceInput`](../interfaces/ProductImageSourceInput)

## Returns

`string`

## Example

```ts
const src = productImageSource(product); // Product | ProductList
const thumbnail = src ? mediaImageUrl(src, { width: 160, height: 160, fit: "cover" }, config.media) : null;
```
