getProductsByStatusMarker
Get a product status by its marker.
Description
Fetches the product status with the given marker; despite the name, it returns the status, not products. Resolves to an IProductStatusEntity.
.getProductsByStatusMarker(
,
);
Parameters schema
Schema
marker(required): string
Marker of the product status.
example: "in_stock"
langCode: string
Language code. Default: the langCode passed to defineOneEntry ("en_US" if none).
example: "en_US"
Examples
Minimal example
const response = await ProductStatuses.getProductsByStatusMarker('sold');
Example with langCode
const response = await ProductStatuses.getProductsByStatusMarker('sold', 'en_US');
Example response
{
"id": 2,
"identifier": "sold",
"localizeInfos": {
"title": "Sold"
},
"version": 0,
"isDefault": false,
"position": 1
}
Response schema
Schema: IProductStatusEntity
id: number
ID of the object.
example: 12345
identifier: string
Text identifier (marker) of the object.
example: "in_stock"
localizeInfos: ILocalizeInfo
Localized name of the product status.
example:
{
"title": "Sold"
}
isDefault: boolean
Whether this is the default status.
example: true
version: number
Version number of the object; changes with each update.
example: 1
position: number
Position used for sorting.
example: 1