8.4.3 Campaign construction General properties  <<  >> Left operand Conditions

With the help of conditions, the behaviour of campaigns can be modified. Instead of being active all the time (given that the start/end times are appropriate), conditions can be used to further refine the circumstances under which a campaign activates: If the conditions are true, the campaign is active; otherwise it is inactive. By default, new campaigns do not have any conditions. This effectively means that the conditions are always true.

When conditions are used in campaigns, it is important to be aware of some, perhaps unexpected, behaviour that this may cause. Mostly this boils down to the fact that shopping cart rows that have been discounted by campaigns, affect condition evaluation for campaigns the same way than normal rows do. This can lead to a scenario where the existence of a campaign in the cart changes the cart, which might in turn affect if the conditions evaluate to true or false for some campaign. Note, however, that cart rows a campaign has added itself are never evaluated in its own conditions.

Here is one, a somewhat contrived example: Lets say we have campaigns A and B. Campaign A adds a freebie product to the cart if the cart total price is greater than 9. Campaign B gives a "buy x, get y" discount to product X. Campaign B is older and/or has a higher importance than campaign A. X's normal price is 5, but if the customer buys three of them, he/she only pays for one. When the cart contains two X products, its total price is 10, and the conditions for campaign A are met, and the freebie is added to the cart. When a third product X is added to the cart, campaign B comes to effect, and the customer pays only for one X. The cart's total price is now 5, so campaign A's conditions are no longer true, and the freebie is removed from the cart.

New conditions are added via the "add" button. Once added, the properties of a condition must be defined. The different properties are explained in the following chapters. Left operand Negation Operator Right operand Multiple conditions, parenthesis and condition evaluation order