Skip to main content

Interface: UseProductInfoReturn

Defined in: composables/react/useProductInfo.ts:72

State and fetch actions returned by useProductInfo.

Properties​

cluster​

cluster: Cluster | null

Defined in: composables/react/useProductInfo.ts:76

The fetched cluster, or null.


clusterImageUrl​

clusterImageUrl: string

Defined in: composables/react/useProductInfo.ts:93

First image URL of the cluster's default product, or ''.


clusterName​

clusterName: string

Defined in: composables/react/useProductInfo.ts:87

Cluster name, falling back to the default product's name.


clusterPrice​

clusterPrice: number | null

Defined in: composables/react/useProductInfo.ts:91

Cluster gross price taken from the default product, or null.


clusterSku​

clusterSku: string

Defined in: composables/react/useProductInfo.ts:89

Cluster SKU, falling back to the default product's SKU.


error​

error: string | null

Defined in: composables/react/useProductInfo.ts:80

Last error message, or null.


fetchCluster​

fetchCluster: (clusterId, imageSearchFilters?, imageVariantFilters?) => Promise<void>

Defined in: composables/react/useProductInfo.ts:84

Fetches a cluster by id, optionally overriding the image filters.

Parameters​

clusterId​

number

imageSearchFilters?​

MediaImageProductSearchInput

imageVariantFilters?​

TransformationsInput

Returns​

Promise<void>


fetchProduct​

fetchProduct: (productId, imageSearchFilters?, imageVariantFilters?) => Promise<void>

Defined in: composables/react/useProductInfo.ts:82

Fetches a product by id, optionally overriding the image filters.

Parameters​

productId​

number

imageSearchFilters?​

MediaImageProductSearchInput

imageVariantFilters?​

TransformationsInput

Returns​

Promise<void>


loading​

loading: boolean

Defined in: composables/react/useProductInfo.ts:78

true while a product/cluster fetch is in flight.


product​

product: Product | null

Defined in: composables/react/useProductInfo.ts:74

The fetched product, or null.