User Manual/Administration Interface/Coupon decorators

A decorator can add additional features on top of coupons only by configuration. For example, if a fixed rebate should only be granted when the total basket value is above a certain limit, then this can be done by an additional decorator added to the configured coupon. The great advantage of decorators is that they can be reused in any combination with all coupons. It's like a set of rules that can be rearranged to create different rule sets only with a small amount of rules.

Usage
Decorators are activated by adding their name comma separated after the coupon provider name in the "Provider" field in the detail view of a coupon item. If currently a fixed rebate (provided by the FixedRebate coupon provider) is configured like this

FixedRebate

the decorator checking for a lower limit of the basket value is added via

FixedRebate,BasketValues

If you would like to restrict the coupon also to the availability of a certain product in the basket, you can additionally add the "Required" decorator:

FixedRebate,BasketValues,Required

The decorators are called from right to left, so at first the "Required" decorator is executed, afterwards the "BasketValues" decorator and at last the "FixedRebate" coupon provider. Therefore, it's a good idea to add the decorators requiring less resources at the end and the decorators using external sources just before the coupon provider.

BasketValues
Tests if the total value of the basket (including service costs for delivery and payment) is above or below the configured limits.


 * basketvalues.total-value-min (optional) : The minimum value before the coupon has any effect. The format is a JSON encoded map of the currency ID and the value in x.xx format, e.g. {"EUR":"1.00","USD":"1.00"}


 * basketvalues.total-value-max (optional) : The maximum value after the coupon has no effect any more. The format is a JSON encoded map of the currency ID and the value in x.xx format, e.g. {"EUR":"1.00","USD":"1.00"}

Required
Tests if a certain product is in the basket of the customer.


 * required.productcode (optional) : The unique code of a product that must be in the basket before the action of the configured coupon is executed.

<< Previous: Coupon details