The rules for products that can be added
What the product must have
Variants are supported. The voucher can therefore also add a product for which the buyer still chooses a size or color.
What is not possible
These product types can not be added:- Upload products
- Set products
- Products with dynamic stock
What the buyer can do with it
If the buyer enters the same voucher again while its products are already in the basket, the shop does not add them a second time. The quantity remains one.
Added products are marked as such in the order data and can therefore be distinguished from regularly purchased items in the merchandise management system.
Prerequisites
The voucher generator must be activated. If you want to use it, contact your WEBSALE representative.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: Marking the products
In the WSPManager or in your merchandise management system, set the fieldVoucherProduct for the product in question.
Step 2: Configuring the voucher
When creating the voucher in the voucher generator, enter the product numbers, at most three, in the Products for basket field.The upper limit of three products is fixed in the shop and cannot be increased. If more numbers are stored, the shop processes the first three.
Step 3: Defining the notice message
If someone tries to add a voucher product to the basket directly from the product detail view, the shop rejects this. The text for this is located in theshop.config.
Step 4: Adjusting the quantity field in the product detail view
The quantity of an added product is always one. On the product detail view, the quantity field for these products therefore belongs in the form as a hidden field, so that the buyer does not even enter a quantity that the shop then discards.Step 5: Marking voucher products (optional)
A notice is worthwhile in two places, each with the same pattern: a section that only applies to voucher products.The notice in the basket is more than cosmetic. Because the item cannot be deleted individually, the buyer would otherwise look for the missing delete icon. The sentence explains where the item comes from.
Step 6: Unresolved voucher products (optional)
If an added product has variants, there are two options. Either you define the variant in the voucher, in which case nothing else needs to be done. Or the buyer should choose it themselves. In this case, the product initially ends up in the basket unresolved, and the order can only be completed once the choice has been made. This section describes the second case and consists of three parts: the configuration, the notice in the basket, and the selection itself.6.1 Activating the function
6.2 Displaying the notice in the basket
6.3 Offering variant selection in the basket
The selection itself runs via AJAX and a dedicated template. The following example uses FastInclude.Addition in the FastInclude file
Insert the following block in theIncl-Basket section of the file incl_fast_includes.htm.
The switch
DC-FPshowVariationBtn is reset for each basket item and only set if the item is either an unresolved voucher product or a voucher product with variants. As a result, the button only appears where there is something to choose.The container for the display
The container belongs outsideFORM-Basket, because the displayed template brings its own form and nested forms do not work in the browser.
The template incl_voucher_product_change.htm
Create a new template with this name in your template directory, for example under benutzer/templates, or in a multilingual shop in the directory of the respective subshop.
The save button is disabled as long as no valid variant combination is selected or the selected combination is not available. This way, the buyer cannot submit a selection that the shop would then have to reject.
Related topics
- Guide: Offering vouchers: Overview
- Guide: Create or import vouchers
- Guide: Provide voucher entry
