RecommendationsActions
RecommendationsActions
This is for:
DeveloperThe recommendations action creators.
See Dispatch Actions.
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
-
payload:
FetchRecommendationsPayload
The action creator payload.
Returns AsyncThunkAction<QueryRecommendationsCommerceAPIThunkReturn, FetchRecommendationsPayload, AsyncThunkCommerceOptions<StateNeededByFetchRecommendations>>
: A dispatchable action.
promoteChildToParent
Promotes a child product to a parent product.
Parameters
-
payload:
PromoteChildToParentPayload
The action creator payload.
Returns PayloadAction<PromoteChildToParentPayload>
: A dispatchable action.
registerRecommendationsSlot
Registers a recommendations slot.
Parameters
-
payload:
SlotIdPayload
The action creator payload.
Returns PayloadAction<RegisterRecommendationsSlotPayload>
: A dispatchable action.
Related Types
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.