docs
  1. Features
  2. Product Listing Page
  3. Composables

Interfaces

AppliedFiltersOptions

Properties

PropertyType
filtersPrefixstring

ModuleOptions

Properties

PropertyType
autoImports?boolean

ProductListSortOptions

Properties

PropertyType
defaultSortingKey?string
sortingOptionsMaybeRefOrGetter<SelectedSort>

ProductsForListingOptions

Properties

PropertyType
fetchingKeystring
fetchingOptionsPartial<{ immediate: boolean; lazy: boolean; }>
paramsRef<Omit<FetchProductsByCategoryParams, "category">>

UseAppliedFiltersReturn

Properties

PropertyTypeDescription
appliedAttributeValuesComputedRef<AppliedAttributeValues>A computed property that returns a record mapping attribute keys to arrays of numbers representing selected values for each attribute.
appliedBooleanValuesComputedRef<AppliedBooleanValues>A computed property that returns a record mapping attribute keys to their boolean values for boolean filters.
appliedFilterComputedRef<ProductSearchQuery>A computed property returning a ProductSearchQuery object based on the route's query parameters.
appliedFiltersCountComputedRef<number>A computed property that returns the total count of applied filters. Counts minPrice/maxPrice as one and counts each attribute filter separately.
areFiltersAppliedComputedRef<boolean>A computed property that returns true if any filters are currently applied, otherwise false.

UseProductListingSeoDataReturn

Properties

PropertyTypeDescription
canonicalLinkComputedRef<CanonicalLink>A computed canonical link.
categoryBreadcrumbSchemaComputedRef<[] | WithContext<...>>A computed breadcrumb schema.
robotsComputedRef<string>A computed robots. Value can be index,follow or noindex,follow.
titleComputedRef<string>A computed string that is constructed from breadcrumb values.

UseProductListSortReturn

Properties

PropertyTypeDescription
isDefaultSortSelectedComputedRef<boolean>Indicating if the default sort is selected.
selectedSortComputedRef<undefined | SelectedSort>The currently selected sorting option.
sortLinksComputedRef<SortLink>Links with updated query parameters for each sorting option.

Type Aliases

AppliedAttributeValues


AppliedBooleanValues



FiltersForListingOptions


RangeTuple


SelectedSort

Type Declaration

NameType
keystring
labelstring

ShopCategory

Type Declaration

NameType
categoryCategory

Type Declaration

NameType
toRouteLocationRaw

UrlParams


UseFiltersForListingReturn

Type Declaration

NameTypeDescription
availableFiltersComputedRef<...>Returns computed available filters.
filteredProductCountComputedRef<...>Returns the count of the products which the applied filter returns.

UseProductsForListingReturn

Type Declaration

NameTypeDescription
paginationComputedRef<...>A computed object containing pagination details for the product list.
paginationOffsetComputedRef<...>-
productsComputedRef<...>A computed array of products in the specified category.
totalProductsCountComputedRef<...>A computed offset for the current page based on the pagination data.

Variables


DEFAULT_SORTING_KEY


filtersFactory


module


SORT_DATE_NEWEST

Type Declaration

NameTypeDefault value
by"new"APISortOption.DATE_ADDED
direction"desc"APISortOrder.DESCENDING
keystring'date_newest'

SORT_PRICE_ASC

Type Declaration

NameTypeDefault value
by"price"APISortOption.PRICE
direction"asc"APISortOrder.ASCENDING
keystring'price_asc'

SORT_PRICE_DESC

Type Declaration

NameTypeDefault value
by"price"APISortOption.PRICE
direction"desc"APISortOrder.DESCENDING
keystring'price_desc'

SORT_REDUCTION_DESC

Type Declaration

NameTypeDefault value
by"reduction"APISortOption.REDUCTION
direction"desc"APISortOrder.DESCENDING
keystring'reduction_desc'

SORT_TOP_SELLER

Type Declaration

NameTypeDefault value
direction"desc"APISortOrder.DESCENDING
keystring'top_seller'
sortingKeystring'scayle:v1:balanced-offerings'

Functions

useAllShopCategoriesForId()

Type Parameters

Type ParameterDefault type
DataTShopCategory
PickKeys extends KeysOf<DataT>KeysOf<DataT>
DefaultTnull

Parameters

ParameterTypeDefault value
__namedParametersPartial<{ options: UseRpcOptions<..., ..., ..., ...>; params: MaybeRefOrGetter<...>; }>{}
keystring'useAllShopCategoriesForId'

Returns

UseRpcReturn<"getAllShopCategoriesForId", DataT, PickKeys, DefaultT>


useAppliedFilters()

Composable to manage applied filters based on route query parameters.

Parameters

ParameterTypeDescription
routeRouteLocationNormalizedLoadedGenericRoute object to handle the queries.
optionsAppliedFiltersOptionsConfiguration options for applied filters.

Returns

UseAppliedFiltersReturn

An object containing reactive data and computed properties for managing applied filters:


useFiltersForListing()

Composable to manage filters based on current category ID and route query parameters.

Parameters

ParameterTypeDescription
optionsFiltersForListingOptionsConfiguration options for fetching products.

Returns

  • An object containing reactive data, computed properties and async RPC call for managing filters:

useProductListingSeoData()

Composable for handling product listing SEO data.

Parameters

ParameterTypeDescription
breadcrumbsMaybeRefOrGetter<BreadcrumbItem>Breadcrumb items.
routeRouteLocationNormalizedLoadedGenericThe route object to handle queries.
paramsUrlParamsURL data for constructing the canonical link.
isDefaultSortSelectedMaybeRefOrGetter<boolean>If the default sort is applied on the listing.

Returns

UseProductListingSeoDataReturn

An object containing reactive data and computed properties for managing SEO data.


useProductListSort()

Custom composable to handle product list sorting.

Parameters

ParameterTypeDescription
routeRouteLocationNormalizedLoadedGenericRoute object to handle the queries and path.
optionsProductListSortOptionsOptions for configuring the sorting behavior.

Returns

UseProductListSortReturn

Computed properties and methods related to sorting


useProductsForListing()

Composable to fetch and manage products by category with configurable options.

Parameters

ParameterTypeDescription
optionsPartial<ProductsForListingOptions>Configuration options for fetching products.

Returns

An object containing reactive data and computed properties for managing products by category.