Skip to main content

getProductsEmptyPage

Search all product objects with pagination that do not have a category.

Description

This method searches for product page objects with pagination that do not have a category, based on the provided query parameters (userQuery). It returns a Promise that resolves to an object IProductsResponse.

Products.getProductsEmptyPage( langCode, userQuery );

Parameters schema

Schema

langCode: string
Language code. Default: "en_US"
example: "en_US"

userQuery: IProductsQuery
Optional set query parameters
example:

{
"limit": 30,
"offset": 0,
"sortOrder": "DESC",
"sortKey": "id",
"statusId": 123,
"statusMarker": "in_stock",
"conditionValue": "new",
"conditionMarker": "equals",
"attributeMarker": "color"
}

userQuery.offset(required): number
Parameter for pagination. Default: 0.

userQuery.limit(required): number
Parameter for pagination. Default: 30.

userQuery.sortOrder(required): string
Sort order "DESC" | "ASC". Default: "DESC".

userQuery.sortKey(required): string
Field for sorting (default - null). Possible values: "id", "position", "title", "date", "price". Default: null.

userQuery.templateMarker: string | null
Product page template marker, default null.
example: "template_12345"

userQuery.statusMarker: string | null
Product page status marker, default null.
example: "in_stock"

userQuery.conditionValue: string | null
The value that is being searched for, default null.
example: "new"

userQuery.attributeMarker: string | null
The text identifier of the indexed attribute by which values are filtered, default null.
example: "color"

userQuery.conditionMarker: string | null
Marker of the filter condition by which the values are filtered, default null.
example: "equals"

Examples

Minimal example

const response = await Products.getProductsEmptyPage();

Example with attributes

const userQuery = {
"offset": 0,
"limit": 30,
"sortOrder": "DESC",
"sortKey": "id"
};

const response = await Products.getProductsEmptyPage('en_US', userQuery);

Example response

{
"items": [],
"total": 0
}

Response schema

Schema: IProductsResponse

total: number
The total number of products found.
example: 100

items: IProductsEntity[]
An array of product entities.
example:

[
{
"id": 12345,
"title": "Product 1"
},
{
"id": 67890,
"title": "Product 2"
}
]