Skip to content

ProductAvailability Criterion

The ProductAvailability Search Criterion searches for products by the availability flag, the boolean value set per product or variant.

To search for products that can be ordered, recreate the availability conditions with existing product search criteria, for example LogicalAnd, LogicalOr, and ProductStock. To recreate complex custom availability strategies, you might need to implement custom search criteria for the conditions not covered by the built-in ones.

For more information, see Availability and computed availability.

Arguments

  • (optional) productAvailability - bool representing whether the product is available (default true)

Example

PHP

1
2
3
4
$query = new ProductQuery(
    null,
    new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ProductAvailability(true)
);

REST API

1
2
3
4
5
<ProductQuery>
    <Filter>
        <ProductAvailabilityCriterion>false</ProductAvailabilityCriterion
    </Filter>
</ProductQuery>
1
2
3
4
5
6
7
{
    "ProductQuery": {
        "Filter": {
            "ProductAvailabilityCriterion": false
        }
    }
}