You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pim/product_api.md
+27-8Lines changed: 27 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,13 +58,25 @@ To delete a product, use `LocalProductServiceInterface::deleteProduct()`:
58
58
59
59
### Product variants
60
60
61
+
#### Searching for variants of a specific product
62
+
61
63
You can access the variants of a product by using the [`ProductServiceInterface::findProductVariants()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-ProductServiceInterface.html#method_findProductVariants) method.
62
64
The method takes the product object and a [`ProductVariantQuery`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Values-Product-ProductVariantQuery.html) object as parameters.
63
65
64
-
You can filter variants by variant codes or use product criteria:
To use [Product Search Criteria](product_search_criteria.md) and [Product Sort Clauses](product_sort_clauses.md) with [`ProductVariantQuery`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Values-Product-ProductVariantQuery.html), wrap it with a [`ProductCriterionAdapter`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Values-Content-Query-Criterion-ProductCriterionAdapter.html) class, as in the example below:
From a variant ([`ProductVariantInterface`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Values-ProductVariantInterface.html)), you can access the attributes that are used to generate the variant by using [`ProductVariantInterface::getDiscriminatorAttributes()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Values-ProductVariantInterface.html#method_getDiscriminatorAttributes).
@@ -73,20 +85,27 @@ From a variant ([`ProductVariantInterface`](/api/php_api/php_api_reference/class
See [Product Search Criteria](product_search_criteria.md) and [Product Sort Clauses](product_sort_clauses.md) references for more information about how to use the [`ProductVariantQuery`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Values-Product-ProductVariantQuery.html) class.
77
-
78
-
#### Searching variants across products
88
+
#### Searching for variants across all products
79
89
80
90
To search for variants across all products, use [`ProductServiceInterface::findVariants()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-ProductServiceInterface.html#method_findVariants).
81
91
This method takes a [`ProductVariantQuery`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Values-Product-ProductVariantQuery.html) object and returns variants regardless of their base product.
82
92
83
93
Unlike `findProductVariants()`, which requires a specific product object, `findVariants()` allows you to search the entire variant catalog.
84
94
85
-
You can filter variants using Product Criteria wrapped in a [`ProductCriterionAdapter`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Values-Content-Query-Criterion-ProductCriterionAdapter.html).
86
-
For example, you can search for variants with specific product codes or attribute values, as below:
To use [Product Search Criteria](product_search_criteria.md) and [Product Sort Clauses](product_sort_clauses.md) with [`ProductVariantQuery`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Values-Product-ProductVariantQuery.html), wrap it with a [`ProductCriterionAdapter`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Values-Content-Query-Criterion-ProductCriterionAdapter.html) class, as in the example below:
Copy file name to clipboardExpand all lines: docs/search/criteria_reference/product_search_criteria.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,13 @@ page_type: reference
5
5
6
6
# Product Search Criteria reference
7
7
8
-
Product Search Criteria are supported by [Product Search (`ProductServiceInterface::findProduct`)](product_api.md#products).
8
+
Product Search Criteria are supported by [product and product variant search)](product_api.md#products) with the following methods:
9
9
10
-
Search Criterion let you filter product by specific attributes, for example, color, availability, or price.
10
+
-`ProductServiceInterface::findProducts()`
11
+
-`ProductServiceInterface::findProductVariants()`
12
+
-`ProductServiceInterface::findVariants()`
11
13
12
-
Product Search Criteria can also be used with `ProductVariantQuery` when wrapped in a [`ProductCriterionAdapter`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ProductCatalog-Values-Content-Query-Criterion-ProductCriterionAdapter.html).
13
-
See the [product variant search examples](product_api.md#searching-variants-across-products) for more information.
14
+
Search Criterion let you filter product by specific attributes, for example, color, availability, or price.
0 commit comments