ProductListingActions (Commerce Engine)

This is for:

Developer

The product listing action creators.

Loader Function

loadProductListingActions

Loads the commerce product listing reducer and returns the available product listing action creators.

Parameters

  • engine: CommerceEngine

    The headless commerce engine.

Returns ProductListingActionCreators: The product listing action creators.

ProductListingActionCreators

fetchMoreProducts

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

Returns AsyncThunkAction<QueryCommerceAPIThunkReturn | null, void, AsyncThunkCommerceOptions<StateNeededByFetchProductListing>>: A dispatchable action.

fetchProductListing

Refreshes the product listing.

Returns AsyncThunkAction<QueryCommerceAPIThunkReturn, void, AsyncThunkCommerceOptions<StateNeededByFetchProductListing>>: A dispatchable action.

promoteChildToParent

Promotes a child product to a parent product.

Parameters

Returns PayloadAction<PromoteChildToParentPayload>: A dispatchable action.

PromoteChildToParentPayload

Properties

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

  • query: string

    The initial basic query expression for instant products.

  • id: string

    The search box ID.