SearchActions (Commerce Engine)
SearchActions (Commerce Engine)
|
|
Note
This component was introduced in version |
The search action creators.
See Dispatch Actions.
Loader Function
loadSearchActions
Loads the commerce search reducer and returns the available search action creators.
Parameters
-
engine:
CommerceEngineThe headless commerce engine.
Returns SearchActionCreators: The search action creators.
SearchActionCreators
executeSearch
Executes a search query.
Returns AsyncThunkAction<QuerySearchCommerceAPIThunkReturn, void, AsyncThunkCommerceOptions<StateNeededByExecuteSearch>>: A dispatchable action.
fetchMoreProducts
Fetches and additional page of products and appends it to the current list.
Returns AsyncThunkAction<QuerySearchCommerceAPIThunkReturn | null, void, AsyncThunkCommerceOptions<StateNeededByExecuteSearch>>: A dispatchable action.
prepareForSearchWithQuery
Updates the query, resets the pagination, and optionally clears all facets in preparation for a new search query.
Parameters
-
payload:
UpdateQueryPayload & PrepareForSearchWithQueryOptionsThe action creator payload.
Returns AsyncThunkAction<void, PrepareForSearchWithQueryPayload, AsyncThunkCommerceOptions<StateNeededByExecuteSearch>>: A dispatchable action.
promoteChildToParent
Promotes a child product to a parent product.
Parameters
-
payload:
PromoteChildToParentPayloadThe action creator payload.
Returns PayloadAction<PromoteChildToParentPayload>: A dispatchable action.
Related types
PromoteChildToParentPayload
Properties
-
child:
Omit<BaseProduct, 'children' | 'totalNumberOfChildren'> -
query:
stringThe initial basic query expression for instant products.
-
id:
stringThe search box ID.