Skip to content
For AI agents: the complete documentation index is available at llms.txt; this page is also available as Markdown at index.md.

ProductCategorySubtree Criterion

The ProductCategorySubtree Search Criterion searches for products assigned to a given product category or any of its subcategories.

Unlike the ProductCategory criterion, which matches products assigned to specific category IDs, ProductCategorySubtree matches the entire subtree rooted at the provided category, including all descendant categories.

Arguments

  • taxonomyEntryId - int representing the ID of the root taxonomy entry (product category) of the subtree to search within

Example

PHP

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<?php declare(strict_types=1);

use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery;
use Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductCategorySubtree;

$taxonomyEntryId = 42;
$criteria = new ProductCategorySubtree($taxonomyEntryId);

/** @var \Ibexa\Contracts\ProductCatalog\ProductServiceInterface $productService */
$productQuery = new ProductQuery();
$productQuery->setQuery($criteria);
$results = $productService->findProducts($productQuery);