Product blocks
Blocks can be linked not only to pages, but also to products. They can also provide additional information, connecting the catalog with additional functionality.
Kotlin Multiplatform
Blocks Attached to Products
By knowing the product ID, you can request the blocks attached to it.
val product: Product = //...
val blocks = CatalogService.blocks(
id = product.id
)
Similar Products Formed by the Block
To request products formed by the block of similar products, you need to know its marker.
val block: Block = //...
val result = CatalogService.similarByBlock(
marker = block.identifier,
offset = 0,
limit = 30,
langCode = "en_US"
)
val products = result.items
Products Formed by the Block
Similarly to the similar products, you can request products from a standard product block.
val block: Block = //...
val result = CatalogService.byBlock(
marker = block.identifier,
offset = 0,
limit = 30,
langCode = "en_US"
)
val products = result.items
Swift
Blocks Attached to Products
By knowing the product ID, you can request the blocks attached to it.
let product: Product = //...
let blocks = try await CatalogService.shared.blocks(
id: product.id
)
Similar Products Formed by the Block
To request products formed by the block of similar products, you need to know its marker.
let block: Block = //...
let result = CatalogService.shared.similarByBlock(
marker: block.identifier,
offset: 0,
limit: 30,
langCode: "en_US"
)
let products = result.items()
Products Formed by the Block
Similarly to the similar products, you can request products from a standard product block.
let block: Block = //...
let result = CatalogService.shared.byBlock(
marker: block.identifier,
offset: 0,
limit: 30,
langCode: "en_US"
)
let products = result.items()
Last modified: 18 February 2025