How the check works
The shop goes through the basket and checks each item against the stored filters. One matching item is enough for the voucher to be accepted. If not a single item matches, the shop rejects it.Multiple filters are combined with OR. A voucher with two filters therefore applies as soon as one basket item meets either of them. An AND combination can only be achieved via a single field with suitably prepared values.
Prerequisite
The voucher generator must be activated. Contact your WEBSALE representative to arrange this.If the vouchers come from an external system and are therefore not in WEBSALE format, add the entry
ExternalVouchers-Allow = yes in the <Voucher-Txt> section of the shop.config.Step 1: Pass the product data field to the basket
The shop only checks fields that are actually available in the basket. Therefore, enter the desired field in theshop.config.
Step 2: Create the filter in the voucher
When creating the voucher in the voucher generator, enter a string following the scheme below in the Kundenspezifische Features (custom features) field at the very bottom.Behavior for set products
Only the value
single is evaluated. Any other value and an empty entry mean asUnit. A typo in single therefore silently results in unit behavior.The total length of the string is limited to 1000 characters. Multiple
<filter> brackets can be specified one after another in the same <g> group and are combined with OR.The inverse variant
In addition to the filter described, the shop also supports the same structure as an exclusion. To use it, enterAdditionalProductFieldsFilterNegative as the type; everything else stays the same.
Step 3: Output the configuration in the template
For verification, you can display which checks are attached to an entered voucher.The set behavior applies to the whole group, not per filter. It therefore belongs before the loop, not inside it.
VOUCHER-SpecialFeatures_AddProdFieldsFilter_Filter_ValueInList outputs the list of values with a leading and trailing comma, i.e. ,a,b,c,. This is how it is stored internally so that the shop can reliably check for whole values. For display purposes, remove the outer commas.The same tag pattern exists for the inverse variant, with
AddProdFieldsFilterNegative instead of AddProdFieldsFilter.Step 4: Add the error message
If no basket item matches the filter, the shop rejects the voucher with reason 21. Add this reason wherever you have integrated the voucher entry, i.e. on the basket pagews_basket.htm or the order overview page ws_place_order.htm.
Related topics
- Guide: Offering vouchers: Overview
- Guide: Creating or importing vouchers
- Guide: Providing voucher entry
- Guide: Vouchers depending on stock level
