SearchActions (Commerce Engine)
SearchActions (Commerce Engine)
This is for:
DeveloperThe search action creators.
See Dispatch Actions.
Loader Function
loadSearchActions
Loads the commerce search reducer and returns the available search action creators.
Parameters
-
engine:
CommerceEngine
The 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 & PrepareForSearchWithQueryOptions
The action creator payload.
Returns AsyncThunkAction<void, PrepareForSearchWithQueryPayload, AsyncThunkCommerceOptions<StateNeededByExecuteSearch>>
: 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.
Related Types
PromoteChildToParentPayload
Properties
-
child:
Omit<BaseProduct, 'children' | 'totalNumberOfChildren'>
-
query:
string
The initial basic query expression for instant products.
-
id:
string
The search box ID.