### 8.4.3.3 Product targeting with condition tree

 8.4.3.3.6 Product iterator  <<  8.4.3.3.7  >>  8.4.4 Campaign types

# 8.4.3.3.7 Logic operator

Logic operator is used in two different ways.

When inside product iterator, this condition combines multiple sub-conditions using logic rules.

All conditions are fulfilled - This condition is true only if all the sub-conditions are true for the same product. If the condition is negated, then the condition is true if one or more sub-conditions is not true. (So this is the logic "and"-operator).

One or more conditions are fulfilled - This condition is true if at least one of the sub-conditions are true for the same product. If the condition is negated, then the condition is true only if none of the sub-conditions are true. (So this is the logic "or"-operator.)

Exactly one condition is fulfilled - This condition is true if exactly one sub-condition is true for the same product. This operator does not have much of use, but could be used like this: "product is from group 'specials' or has price over 100€, but is not from group 'specials' with price over 100€". If the condition is negated, then the condition is true if none of the sub-conditions are true, or if more than one sub-condition is true. (So this is the logic "exclusive-or"/"either-or" operator.)

Outside product iterator -condition this rule combines the result product sets produced by multiple sub-conditions. When different sub-conditions return different sets of products (for which each sub-condition apply), the operators can be used to select how to choose the products from the sub-conditions' results into the combined result set.

Note: the condition negation is not available for these operators.

All valid choices - This combines the results from all sub-conditions if all the sub-conditions are true/have results. For example, if this operator has two sub-conditions, "product code X" and "product code Y", and if the whole input set of products has both product X and product Y, then this condition result is a pair of product X and Y. If either or both defined products are not found in the input set, then this conditions is false (consider it to return empty set of products).

One or more valid choices - This combines the results from all sub-conditions that are true/have results. For example, suppose this operator has two sub-conditions, "product code X" and "product code Y". If the cart does not have either of the products, then this condition is false (its result has no products). If the cart has one of the products, then that product is also the result of this condition. If both products are in the cart, then this condition result will have both the products.

First valid choice - This chooses one (first/topmost) of the results of sub-conditions that are true/have results. If all of the sub-conditions are false (returned no results), this condition is also false (returns no results). This can be used, for example, to create product choices. E.g., suppose that sub-conditions are "product code X" and "product code Y". If the cart does not have either of the products, then this conditions is false. If the cart has one of the products, then that product is chosen and this condition is true. If the cart has both products, then the sub-condition fulfilled first (i.e. product X) is chosen and this condition is true.