Product categories
Categories are pages of type Catalog. Thanks to this, products can be combined in a tree-like manner.
Kotlin Multiplatform
Products without a category
Products can be created directly without using categories. You can get all products that do not belong to any type separately.
val result = CatalogService.emptyPage(
offset = 0,
limit = 30,
sortKey = null,
sortOrder = SortOrder.DESC,
langCode = "en_US"
)
val products = result.items
Products of a category
Knowing the category, you can request the products stored within it.
By category identifier
val page: Page = //...
val result = CatalogService.byPage(
id = page.id,
offset = 0,
limit = 30,
sortKey = null,
sortOrder = SortOrder.DESC,
langCode = "en_US",
filter = {
put {
attributeMarker = "rate"
conditionMarker = ConditionMarker.GREATER_THEN
conditionValue = AttributeValue.fromDouble(5.0)
}
}
)
By category link
val page: Page = //...
val result = CatalogService.byPage(
url = page.pageUrl,
offset = 0,
limit = 30,
sortKey = null,
sortOrder = SortOrder.DESC,
langCode = "en_US",
filter = {
put {
attributeMarker = "rate"
conditionMarker = ConditionMarker.GREATER_THEN
conditionValue = AttributeValue.fromDouble(5.0)
}
}
)
Swift
Products without a category
Products can be created directly without using categories. You can get all products that do not belong to any type separately.
let result = try await CatalogService.shared.emptyPage(
offset: 0,
limit: 30,
sortKey: nil,
sortOrder: .desc,
langCode: "en_US"
)
let products = result.items()
Products of a category
Knowing the category, you can request the products stored within it.
By category identifier
let page: Page = //...
let result = try await CatalogService.shared.byPage(
id: page.id,
offset: 0,
limit: 30,
sortKey: nil,
sortOrder: .desc,
langCode: "en_US",
filter: {
ConditionBlock(
attributeMarker: "rate",
conditionMarker: .greaterThen,
conditionValue: .init(double: 5.0)
)
}
)
By category link
let page: Page = //...
let result = try await CatalogService.shared.byPage(
url: page.pageUrl,
offset: 0,
limit: 30,
sortKey: nil,
sortOrder: .desc,
langCode: "en_US",
filter: {
ConditionBlock(
attributeMarker: "rate",
conditionMarker: .greaterThen,
conditionValue: .init(double: 5.0)
)
}
)
Last modified: 18 February 2025