Skip to content

Product Queries

The Product Query Builder allows you to dynamically find products by filtering and sorting them based on their attributes.

The resulting Product Queries can then be used inside the Constraint System to:

  • apply rules to specific products
  • apply rules to groups of products
  • apply rules based on the result of a query
  • control availability, pricing logic, or compatibility

This allows configuration logic to react dynamically to product selections made in the frontend.


Query Types

A Product Query is built using one or more query clauses.

Mercura supports four different query types:

Where

Filters products based on a defined condition.

Example:

Find all products where
Product Type = Valve

When using a Where clause you must define:

SettingDescription
PropertyThe product attribute you want to filter on (e.g. SKU, Type, Category)
OperatorThe comparison method
Value SourceFree variable or constant value

Where Selected

Filters products that are currently selected in the configurator frontend.

This allows rules to react to the user’s configuration in real time.

Example:

Apply a rule if
Any selected product where Category = Motor


Where Not

Filters products that do not match a defined condition.

Example:

Find all products where
Product Type is not Electrical


Where Not Selected

Filters products that are not currently selected in the frontend configurator.

Example:

Apply a rule to all products
that are not selected by the user


Operators

Each Where clause supports the following operators:

OperatorDescription
LIKEMatches values that contain a specified pattern
NOT LIKEExcludes values containing a specified pattern
EQUALMatches values that are identical
NOT EQUALExcludes values that are identical

Value Source

When defining a condition, the value can be retrieved from:

Free Variable

A value provided dynamically from the configurator form or Rule Builder.

Example:

Product Width = Selected Width


Constant Value

A fixed value defined directly in the query.

Example:

Product Category = Standard Motor


Nested Queries

Product Queries can be nested to create more advanced logic.

Supported nesting options:

  • Or Where
  • Or Where Not
  • Order by Ascending
  • Order by Descending
  • Limit

This allows you to:

  • combine multiple conditions
  • prioritise specific products
  • restrict the number of returned results

Example:

Where Category = Pump
Or Where Power Rating > 5kW
Order by Price Descending
Limit 3


Usage in Constraints and Effects

Once created, a Product Query can be referenced directly inside the Constraint System and used within Effects.

This allows you to apply logic not only to individual products, but to the entire result set returned by a query.

Typical Effect actions using Product Queries include:

  • Hide Query Hides all products returned by the query from the configurator frontend.
  • Set Query Automatically selects all products returned by the query.
  • Unset Query Automatically deselects all products returned by the query.

Because Product Queries can reference frontend selections (for example through Where Selected), Effects can dynamically react to the user’s configuration in real time.

This makes it possible to:

  • enforce compatibility rules
  • control available options
  • automate bundle logic
  • apply selection dependencies
  • dynamically guide product configuration

In this way, Product Queries act as reusable product groups that can be targeted by Constraint Effects throughout the configurator logic.