Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/search/aggregation_reference/aggregation_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ There are three types of aggregations:
|---|---|---|
|[Product attribute](product_attribute_aggregations.md) | Term / Range | Product attribute values |
|[ProductAvailabilityTerm](productavailabilityterm_aggregation.md) | Term | Product availability |
|[ProductStockRange](productstockrange_aggregation.md) | Range | Product stock |
|[ProductPriceRange](productpricerange_aggregation.md) | Range | Product price |
|[ProductTypeTerm](producttypeterm_aggregation.md) | Term | Product type |
|[TaxonomyEntryIdAggregation](taxonomyentryid_aggregation.md) | Term | Product category |
21 changes: 21 additions & 0 deletions docs/search/aggregation_reference/productstockrange_aggregation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ProductStockRangeAggregation

The ProductStockRangeAggregation aggregates search results by products' numerical stock.

## Arguments

- `name` - name of the Aggregation
- `ranges` - array of Range objects that define the borders of the specific range sets

## Example

``` php
$productQuery = new ProductQuery();
$productQuery->setAggregations([
new ProductStockRangeAggregation('stock', [
new Range(null, 10),
new Range(10, 100),
new Range(100, null),
]),
]);
```
2 changes: 2 additions & 0 deletions docs/search/criteria_reference/product_search_criteria.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Search Criterion let you to filter product by specific attributes, for example:
|[IntegerAttribute](integerattribute_criterion.md)|Value of product's integer attribute|
|[SelectionAttribute](selectionattribute_criterion.md)|Value of product's selection attribute|
|[ProductAvailability](productavailability_criterion.md)|Product's availability|
|[ProductStock](productstock_criterion.md)|Product's numerical stock|
|[ProductStockRange](productstockrange_criterion.md)|Product's numerical stock|
|[ProductCategory](productcategory_criterion.md)|Product category assigned to product|
|[ProductCode](productcode_criterion.md)|Product's code|
|[ProductName](productname_criterion.md)|Product's name|
Expand Down
26 changes: 26 additions & 0 deletions docs/search/criteria_reference/productstock_criterion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ProductStock Criterion

The `ProductStock` Search Criterion searches for products by their numerical stock.

## Arguments

- `value` - the numerical stock to search for
- (optional) `operator` - operator string (`=` `<` `<=` `>` `>=`)

## Example

``` php
$productQuery = new ProductQuery(
null,
new Criterion\ProductStock(10)
);
```

``` php
$productQuery = new ProductQuery(
null,
new Criterion\ProductStock(50, '>=')
);
```


19 changes: 19 additions & 0 deletions docs/search/criteria_reference/productstockrange_criterion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# ProductStockRange Criterion

The `ProductStockRange` Search Criterion searches for products by their numerical stock.

## Arguments

- `min` - minimum stock
- `max` - maximum stock

## Example

``` php
$productQuery = new ProductQuery(
null,
new Criterion\ProductStockRange(10, 120)
);
```


3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ nav:
- FloatAttribute: search/criteria_reference/floatattribute_criterion.md
- IntegerAttribute: search/criteria_reference/integerattribute_criterion.md
- ProductAvailability: search/criteria_reference/productavailability_criterion.md
- ProductStock: search/criteria_reference/productstock_criterion.md
- ProductStockRange: search/criteria_reference/productstockrange_criterion.md
- ProductCategory: search/criteria_reference/productcategory_criterion.md
- ProductCode: search/criteria_reference/productcode_criterion.md
- ProductName: search/criteria_reference/productname_criterion.md
Expand Down Expand Up @@ -596,6 +598,7 @@ nav:
- KeywordTermAggregation: search/aggregation_reference/keywordterm_aggregation.md
- Product attribute aggregations: search/aggregation_reference/product_attribute_aggregations.md
- ProductAvailabilityTermAggregation: search/aggregation_reference/productavailabilityterm_aggregation.md
- ProductStockRangeAggregation: search/aggregation_reference/productstockrange_aggregation.md
- ProductPriceRangeAggregation: search/aggregation_reference/productpricerange_aggregation.md
- ProductTypeTermAggregation: search/aggregation_reference/producttypeterm_aggregation.md
- SelectionTermAggregation: search/aggregation_reference/selectionterm_aggregation.md
Expand Down