Skip to content

ColorAttribute Criterion

The ColorAttribute Search Criterion searches for products by the value of their color attribute.

Arguments

  • identifier - string representing the attribute
  • value - array of strings representing the attribute values

Example

PHP

1
2
3
4
$query = new ProductQuery(
    null,
    new \Ibexa\Contracts\ProductCatalog\Values\Product\Query\Criterion\ColorAttribute('color', ['#FF0000'])
);

REST API

1
2
3
4
5
6
7
8
<AttributeQuery>
    <Query>
        <ColorAttributeCriterion>
            <identifier>color</identifier>
            <value>#000000</value>
        </ColorAttributeCriterion>
    </Query>
</AttributeQuery>
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "AttributeQuery": {
    "Query": {
      "ColorAttributeCriterion": {
            "identifier": "color",
            "value": ["#000000"]
        },
    }
  }
}