@plentymarkets/shop-api / facetGetters
Variable: facetGetters ​
constfacetGetters:object
Defined in: getters/facetGetters.ts:176
Type Declaration ​
getAll ​
getAll: (
params,criteria?) =>AgnosticFacet[]
Parameters ​
params ​
FacetSearchResult<Facet>
The facet search result (currently unused).
criteria? ​
Optional search criteria (currently unused).
Returns ​
AgnosticFacet[]
An empty array.
Deprecated ​
Not yet implemented — always returns an empty array.
getCategory ​
getCategory: (
params) =>Category
Returns the category associated with a facet search result.
Parameters ​
params ​
FacetSearchResult<Facet>
The facet search result.
Returns ​
The Category object from the search data.
getCssClass ​
getCssClass: (
filter) =>string
Returns the CSS class associated with a filter value.
Parameters ​
filter ​
The filter object.
Returns ​
string
The CSS class string, or an empty string if not set.
getFilterCount ​
getFilterCount: (
filter) =>number
Returns the item count associated with a filter value.
Parameters ​
filter ​
The filter object.
Returns ​
number
The item count, or 0 if not set.
getFilterName ​
getFilterName: (
filter) =>string
Returns the display name of a filter value.
Parameters ​
filter ​
The filter object.
Returns ​
string
The filter name string, or an empty string if not set.
getFilters ​
getFilters: (
filterGroup) =>Filter[]
Returns the individual filter values within a filter group.
Parameters ​
filterGroup ​
The filter group object.
Returns ​
Filter[]
An array of Filter objects, or an empty array if none exist.
getName ​
getName: (
filterGroup) =>string
Returns the display name of a filter group.
Parameters ​
filterGroup ​
The filter group object.
Returns ​
string
The filter group name string, or an empty string if not set.
getPagination ​
getPagination: (
params) =>AgnosticPagination
Returns the pagination data for a facet search result.
Parameters ​
params ​
FacetSearchResult<Facet>
The facet search result containing pagination and input data.
Returns ​
AgnosticPagination
An AgnosticPagination object with current page, total pages, total items, items per page, and page options.
getProducts ​
getProducts: (
searchData) =>Product[]
Returns the list of products from a facet search result.
Parameters ​
searchData ​
FacetSearchResult<Facet>
The facet search result.
Returns ​
Product[]
An array of Product objects, or an empty array if none exist.
getSortOptions ​
getSortOptions: (
params) =>AgnosticSort
Returns the available sort options for a facet search, with the currently selected option marked.
Parameters ​
params ​
FacetSearchResult<Facet>
The facet search result containing the selected sort input.
Returns ​
AgnosticSort
An AgnosticSort object with an array of sort options and the currently selected option ID.
getType ​
getType: (
filterGroup) =>string
Returns the type of a filter group (e.g. "price", "attribute", "availability").
Parameters ​
filterGroup ​
The filter group object.
Returns ​
string
The filter group type string, or an empty string if not set.
hasFilters ​
hasFilters: (
filterGroup) =>boolean
Returns whether the given filter group list contains at least one group.
Parameters ​
filterGroup ​
The array of filter group objects.
Returns ​
boolean
true if there is at least one filter group, otherwise false.