THIS IS ARCHIVED DOCUMENTATION

(Deprecated) CartRecommendationsList

Methods

refresh

Gets new recommendations based on the current SKUs.

setSkus

Sets the SKUs in the cart.

Parameters

  • skus: string[]

    The SKUs of products in the cart.

subscribe

Adds a callback that will be called on state change.

Parameters

  • listener: () ⇒ void

    A callback to be invoked on state change.

Returns Unsubscribe: An unsubscribe function to remove the listener.

Attributes

state

The state of the CartRecommendationsList controller.

Properties

  • error: ErrorPayload | null

    The error returned by Coveo while executing the cart recommendation request, if any. null otherwise.

  • isLoading: boolean

    Whether the cart recommendation request is currently being executed against Coveo.

  • maxNumberOfRecommendations: number

    The maximum number of recommendations.

  • recommendations: ProductRecommendation[]

    The products recommended by Coveo.

  • skus: string[]

    The SKUs of products in the cart.

Initialize

buildCartRecommendationsList

Creates a CartRecommendationsList controller instance.

Parameters

  • engine: ProductRecommendationEngine

    The headless engine.

  • props: CartRecommendationsListProps

    The configurable CartRecommendationsList properties.

Returns CartRecommendationsList

CartRecommendationsListProps

The configurable CartRecommendationsList properties.

Properties

CartRecommendationsListOptions

Properties

  • additionalFields?: string[]

    Additional fields to fetch in the results.

  • maxNumberOfRecommendations?: number

    The maximum number of recommendations, from 1 to 50.

    Default: 5

  • skus?: string[]

    The SKUs of products in the cart.

ProductRecommendation

Properties

  • additionalFields: Record<string, unknown>

    An object containing the requested additional fields for the product.

  • clickUri: string

    A direct link to the product in URL format.

  • permanentid: string

    The SKU of the product.

  • brand?: string

  • category?: string

  • ec_brand?: string

    Product brand.

    From the ec_brand field.

  • ec_category?: string

    Category of the product (for example, "Electronics", "Electronics|Televisions", or "Electronics|Televisions|4K Televisions")

    From the ec_category field.

  • ec_images?: string[]

    Additional product images in URL format.

    From the ec_images field.

  • ec_in_stock?: boolean

    Availability of the product (that is, whether the product is in stock).

    From the ec_in_stock field.

  • ec_name?: string

    Name of the product.

    From the ec_name field.

  • ec_price?: number

    Base price of the product or variant.

    From the ec_price field.

  • ec_promo_price?: number

    Promotional price of product or variant.

    From the ec_promo_price field.

  • ec_rating?: number

    A rating based system from 0-10.

    From the ec_rating field.

  • ec_shortdesc?: string

    Short description of the product.

    From the ec_shortdesc field.

  • ec_thumbnails?: string[]

    Product images in URL format.

    From the ec_thumbnails field.

  • imageUrls?: string[]

  • inStock?: boolean

  • link?: string

  • name?: string

  • price?: number

  • promoPrice?: number

  • rating?: number

  • shortDescription?: string

  • sku?: string

  • thumbnailUrl?: string

Unsubscribe

Call signatures

  • (): void