VOUCHER- tags access these fields. They answer two different questions: what about the voucher the buyer has just redeemed, and what is behind any given voucher number.
Guide: Offering vouchers
The one rule that applies to all tags
Every tag on this page needs a voucher to refer to. There are exactly two ways to provide one.The previous documentation repeats this rule on every single tag page. On the new page, it is stated once here, and the sections below only point out deviations.
Loading a voucher
VOUCHER-LoadData() loads a voucher by its number. The argument supports tag-in-tag.
The voucher is loaded regardless of whether the buyer could currently redeem it. An expired or already used-up voucher can therefore still be displayed this way. That is exactly the purpose, for example for a “Your voucher” status page.
Number, batch and currency
A voucher can carry several batch labels.
VOUCHER-ChargeLabel then outputs them as a comma-separated list. The selection list is in the ChargeLabelValues section of global.config, and the ChargeLabel section lets you make the entry mandatory.Value and deduction type
First the question of how the voucher calculates, then the question of how much.VOUCHER-AmountType_code outputs the same code as a number.
All value tags also work as bracketing, namely when a value is stored. For a percentage voucher,
VOUCHER-Value_absoluteamount is empty and vice versa. So first query the deduction type and output the matching value within it.The deduction of the set sub-product price is a special case for set products. A maximum amount cannot be set additionally in this case. Your contact at WEBSALE AG can advise you on this voucher type.
Validity and redemption limits
VOUCHER-ValidInSubhops_list returns a raw list. The DC- tags let you split it into individual entries.How far away the minimum order value still is
Three more tags do not refer to the voucher but to the current basket.These three tags are available in the shop system but are not described in the previous documentation. They make the difference between “voucher cannot be redeemed” and “twelve euros still missing”, and the latter sells better.
The values already come in the shop’s number format. You add the currency symbol yourself.
The voucher types
VOUCHER-Type_code outputs the type as a number, eight bracketings query it individually.
Codes 0 to 6 combine three characteristics: individual or universal voucher, remaining amount usable or expiring, and whether login is required. Codes 3 to 6 require a logged-in customer.
Type 7 is the special case: this voucher can be redeemed multiple times but binds itself on first redemption to the account that used it first. After that, it is blocked for other accounts.
VOUCHER-BoundUserIndex tells you which account.Promotional voucher or purchased voucher
VOUCHER-CampaignType_code outputs the code as a number.
Product and category filters
Three bracketings tell you whether and how a filter is set, a loop lists the rules.A filter can contain including and excluding rules at the same time. That is why the distinction exists twice: once at voucher level as
_active_onlyValidFor and _active_notValidFor, and once per rule as _data_type_isOnlyValidFor and _data_type_isNotValidFor.Set products in the filter
VOUCHER-CatProdFilter_SetBehavior outputs the code as a number.
Customer filter
Same structure as the product filter, only with customers instead of products.Added products
A voucher can add products to the basket, for example a free gift.Multiple currencies
If a voucher is stored for several currencies, five tags output the values in a technical format that can be split with theDC- tags.
The currency list comes in the first form, all others in the second with currency and amount per group. To split them, use
DC-DynamicLoopX_setSeparatorTags() and DC-DynamicLoopX_settaggedData(), and for the amount groups additionally DC-FPX_extractTaggedData().For a multi-currency voucher, the simple tags such as
VOUCHER-Value_absoluteamount return the value in the currency of the current process. You only need the multi-currency tags if you want to show all currencies at once.Special functions
These bracketings tell you which additional rules apply to the voucher.VOUCHER-SpecialFeatures, _DisableOtherDiscounts and _DisableAutoBasket are available in the shop system but are not described in the previous documentation. The first is suitable as a frame around the entire block of special notices.Dependency on stock level
Dependency on free product data fields
A voucher can be tied to a free product data field containing a certain value. The same check also exists in the opposite direction as an exclusion.The same five tags exist with
Negative after AddProdFieldsFilter, that is VOUCHER-SpecialFeatures_AddProdFieldsFilterNegative and so on. They describe items for which the voucher does not apply. These five are available in the shop system but are not described in the previous documentation.Several vouchers at once
If the multiple voucher function is enabled, the buyer can enter additional vouchers.VOUCHER-MultiVoucher loops over them.
As a single tag,
VOUCHER-MultiVoucher outputs the number of additional vouchers. The first one entered does not count; it is located outside the loop.The loop runs over the additional vouchers and appends an empty iteration as long as the maximum number has not been reached, a valid voucher is present and all entered vouchers have been checked and are valid. This empty iteration is the input field for the next voucher.
Are the vouchers compatible
The shop system decides via labels whether two vouchers can be redeemed together. Each voucher has its own labels, plus an inclusion list and an exclusion list.These seven tags are available in the shop system but are not described in the previous documentation. Without them, you cannot explain to a buyer why their second voucher was rejected.
Exclusive means: the same label is in both the inclusion list and the exclusion list. Such a voucher is not compatible with any other voucher from this group.
Meta vouchers
A meta voucher is a collective code behind which several individual vouchers stand. If the buyer enters the collective code, the shop system redeems all the vouchers behind it at once.Only one collective code can be redeemed at a time. Which individual vouchers stand behind it is defined in a configuration file of the shop, not in the voucher generator.
VOUCHER-MetaShowAsBlock controls the display. The value comes from the data of the collective code, and if it is missing there, the setting from the shop configuration applies. With this bracketing, you show the individual vouchers either as one block or listed individually.The four meta tags refer to the session and not to a loaded voucher. They are therefore the only tags on this page that also work outside
{VOUCHER-LoadData()} and {ST-Voucher_OK}. Within the multiple voucher loop, VOUCHER-IsFromMeta additionally accesses the respective voucher.The tags at a glance
All tags are permitted on all templates. What matters is not the template but the frame provided by
{VOUCHER-LoadData()} or {ST-Voucher_OK}, as described at the beginning of this page.Related topics
- Guide: Offering vouchers
- Reference:
ST-Voucher_OKandST-Voucher_checkedon the page ST- (Page state) - Reference:
BT-VoucherandBT-Voucher_deleteon the page BT- (Buttons) - Reference:
WS-VoucherNumberandWS-VoucherNumber_inputon the page WS- (General tags) - Reference: DC- (Data conversion)
