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

***

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

# Function: productStructuredData()

> **productStructuredData**(`product`, `options`): `Record`\<`string`, `unknown`\>

The schema.org `Product` of a product page, for a
`<script type="application/ld+json">` written with `jsonLd()`: name,
description, photos, SKU, its price and stock as an `Offer` — an
`AggregateOffer` with the lowest and highest price when its variants cost
different amounts — and its rating once it has reviews.

## Parameters

### product

#### category?

\{ `createdAt`: `string`; `description?`: `string`; `id`: `string`; `image?`: \{ `height?`: `number`; `key`: `string`; `url`: `string`; `width?`: `number`; \}; `metaDescription?`: `string`; `metaKeywords?`: `string`; `metaTitle?`: `string`; `name`: `string`; `parentId?`: `string`; `position`: `number`; `slug`: `string`; `updatedAt`: `string`; \}

#### category.createdAt

`string`

#### category.description?

`string`

#### category.id

`string`

#### category.image?

\{ `height?`: `number`; `key`: `string`; `url`: `string`; `width?`: `number`; \}

#### category.image.height?

`number`

#### category.image.key

`string`

#### category.image.url

`string`

#### category.image.width?

`number`

#### category.metaDescription?

`string`

#### category.metaKeywords?

`string`

#### category.metaTitle?

`string`

#### category.name

`string`

#### category.parentId?

`string`

#### category.position

`number`

#### category.slug

`string`

#### category.updatedAt

`string`

#### categoryId?

`string`

#### compareAtPrice?

`number`

#### currency

`string`

#### description?

`string`

#### descriptionFormat

`"html"` \| `"text"`

#### descriptionPlain?

`string`

#### handle

`string`

#### hasVariants

`boolean`

#### id

`string`

#### images

`object`[]

#### inventory

`number`

#### lowStockThreshold

`number`

#### metaDescription?

`string`

#### metaTitle?

`string`

#### name

`string`

#### offers

`object`[]

#### price

`number`

#### quantityPricing?

\{ `name`: `string`; `offerId`: `string`; `tiers`: `object`[]; `triggerVariantId?`: `string`; \}

#### quantityPricing.name

`string`

#### quantityPricing.offerId

`string`

#### quantityPricing.tiers

`object`[]

#### quantityPricing.triggerVariantId?

`string`

#### reviewStats?

\{ `avgRating`: `number`; `reviewCount`: `number`; \}

#### reviewStats.avgRating

`number`

#### reviewStats.reviewCount

`number`

#### sku?

`string`

#### tags

`string`[]

#### trackInventory

`boolean`

#### type

`"DIGITAL"` \| `"PHYSICAL"`

#### variantOptions?

`object`[]

#### variants

`object`[]

### options

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

## Returns

`Record`\<`string`, `unknown`\>
