RecommendationsActions

This is for:

Developer

The recommendations action creators.

Loader Function

loadRecommendationsActions

Loads the commerce recommendations reducer and returns the available recommendations action creators.

Parameters

  • engine: CommerceEngine

    The commerce engine.

Returns RecommendationsActionCreator: The recommendations action creators.

RecommendationsActionCreator

fetchMoreRecommendations

Fetches an additional page of recommendations and appends it to the current list.

Parameters

  • payload: FetchRecommendationsPayload

    The action creator payload.

Returns AsyncThunkAction<QueryRecommendationsCommerceAPIThunkReturn | null, FetchMoreRecommendationsPayload, AsyncThunkCommerceOptions<StateNeededByFetchRecommendations>>: A dispatchable action.

fetchRecommendations

Fetches recommendations.

Parameters

Returns AsyncThunkAction<QueryRecommendationsCommerceAPIThunkReturn, FetchRecommendationsPayload, AsyncThunkCommerceOptions<StateNeededByFetchRecommendations>>: A dispatchable action.

promoteChildToParent

Promotes a child product to a parent product.

Parameters

Returns PayloadAction<PromoteChildToParentPayload>: A dispatchable action.

registerRecommendationsSlot

Registers a recommendations slot.

Parameters

  • payload: SlotIdPayload

    The action creator payload.

Returns PayloadAction<RegisterRecommendationsSlotPayload>: A dispatchable action.

FetchRecommendationsPayload

Properties

  • slotId: string

    The unique identifier of the recommendations slot (e.g., b953ab2e-022b-4de4-903f-68b2c0682942).

  • productId?: string

PromoteChildToParentPayload

Properties

  • child: Omit<BaseProduct, 'children' | 'totalNumberOfChildren'>

  • query: string

    The initial basic query expression for instant products.

  • id: string

    The search box ID.