getProductsCountByPageUrl
Search for all product objects with pagination for the selected category (by its URL).
Description
This method ... It returns a Promise that resolves to an IProductsCount..
Products.getProductsCountByPageUrl(
url,
body
);
Parameters schema
Schema
url(required): string
Page url
body(required): any[]
Body parameters for filter. Deault: []
example:
[
{
"attributeMarker": "price",
"conditionMarker": "in",
"statusMarker": "status_1",
"conditionValue": {},
"pageUrls": [
"23-laminat-floorwood-maxima"
],
"title": "Iphone 17 Pro"
}
]
Examples
Minimal example
const response = await Products.getProductsCountByPageUrl('catalog');
Use filters to find specific products:
attributeMarker: The text identifier of the indexed attribute by which values are filtered. conditionMarker: The type of condition to apply to the attribute value.
| Marker | Meaning | Example |
|---|---|---|
| eq | Equal | statusId = 1 (active only) |
| neq | Not equal | category ≠ "archived" |
| in | Contains (one of) | category in ["electronics", "books"] |
| nin | Not contains | brand not in ["fake_brand"] |
| exs | Exists (has value) | Has description |
| nexs | Does not exist | No image |
conditionValue: The value to compare against.
Example response
{
"totalAll": 3,
"totalInCategory": 3,
"totalInCategoryWithNested": 3
}
Response schema
Schema: IProductsCount
totalAll: number
The total number of products found.
example: 100
totalInCategory: number
The total number of products found in category.
example: 50
totalInCategoryWithNested: number
The total number of products found in nested category.
example: 10