Time to read: 16 minutes


With this module, you can create and use vouchers in the PepperShop. Vouchers are organized into campaigns. Using this method, you can define how many vouchers you want to create, their expiration date and the amount (fixed or percentage).

The administration of the voucher module is fully integrated into the PepperShop administration and can be used from any location via a web interface.

The vouchers can either be used for an order or bound to an item. If bound to an item, the coupon will be accepted only if precisely this item occurs in the shopping cart for the order. This possibility helps e.g. with the introduction of a new product.

The vouchers created can be exported via CSV (Character Separated Values), so that they can be edited in Excel, for example, or used for personalized print documents.

With this voucher module, it is also possible to create a voucher item in the shop, where the customer placing can freely choose the value of the voucher.

Redeeming vouchers

After the first voucher campaign has been created, the customer will see an input field for the voucher code in the cash register.

Figure 1: Coupon code field in the cash box (here framed in green)

In the order overview you can see that the coupon will be redeemed. If the voucher code is invalid, a message highlighted with the error color will appear indicating that the voucher code is invalid.

Figure 2: Order overview with valid voucher code (here framed in green)

In the order confirmation e-mail, which the customer and shop operator receives immediately after receipt of the order, the voucher data are also available.

Figure 3: Coupon data in e-mail (framed)


If the coupon module is installed, the point Marketing > Coupons appears in the main menu of the shop administration if one clicks on coupons one is in the coupon administration.

Create vouchers / campaigns

Vouchers are organized into campaigns. If you therefore want to create new vouchers, you create a new campaign. A new campaign can be created by clicking on ‘create new campaign’ in the vouchers main menu. Here you can enter the key data of the new campaign:

Name of the campaign, number of vouchers to be generated, the amount per voucher (either as a fixed amount in the basic shop currency or as a percentage), the expiry date of the voucher and whether the voucher should be linked to an item in the shop or not.

You also specify the number of times the generated vouchers can be used. This can be used, for example, to implement actions such as ‘the first 500 buyers receive…'.

The Type field controls how the voucher is interpreted:

  • Promotion: VAT is calculated here on the basis of the reduced price.
  • Credit note: VAT is calculated on the basis of the original price.

The creation of the vouchers can take a little longer with a number greater than 1000 vouchers…

Figure 4: Voucher data in e-mail (framed)

Voucher code redeemable multiple times

Vouchers can be redeemed only once after creation. The number of possible redemptions can be increased for each voucher in the field possible number of redemptions (edit voucher after creation). The value is automatically reduced with each redeemed voucher.

In the same configuration mask, you can also enter a comment, e.g. to enter a person or something similar.

Minimum purchase amount

For each voucher, a minimum purchase amount can be entered in the field ‘Redeemable from total article’ in the basic currency. The voucher can only be redeemed when the total of the items in the shopping cart reaches or exceeds the minimum purchase amount. If no minimum purchase amount is required, simply enter 0.

Foreign currencies

If you want to use vouchers in foreign currencies, you still have to enter the fixed values here in the basic currency. Depending on the conversion factor, the base currency amount is then displayed translated into the foreign currency.

The current exchange rate can be found in the shop administration in the Currencies menu.

Item binding of a voucher

Item Binding: You can create vouchers for orders. These simply subtract the specified value from the order total. However, if you enter an item number of an existing item in the ‘For article no.’ field, you can also bind a voucher to an article. This means that the voucher only works if you buy this item - this can be used for introductory actions, for example.

Note: The creation of the vouchers can take a little longer with a number greater than 1000 vouchers, because the uniqueness of each individual code is checked after its creation.

After the creation process you will find yourself in the voucher main menu and see the newly created campaign. The Logviewer module now contains a log file (gutschein_kampagnename_datum.csv). This file contains all generated coupon codes of this campaign as CSV data (Character Separated Values), which can be processed automatically - e.g. via Excel or OpenOffice. The log file should be clicked immediately after creation and downloaded as well as deleted in the log directory to prevent misuse by other employees with administration rights.

Article binding of a voucher to the articles of a category

This voucher is then valid for all items in this category and will be charged as a discount per item. The category can be selected via a dialog, or the category number can be entered manually.

Article binding of a voucher based on a special field

You can use a dropdown to select a field on the article (for example, additional field3). Write the value to be checked in the empty field next to it. Each article with the selected field contains the entered value, gets then the possibility of the coupon discount.

Show / delete campaigns

You can view and delete campaigns directly from the voucher main menu.

Vouchers in the campaigns

If you click on ‘show’ in the voucher main menu of a campaign, you will see all(!) vouchers of that campaign displayed in a list form. There is no scrolling functionality. Here you can also see the status of each voucher (code) - e.g. whether it has already been redeemed.

Vouchers can also be displayed or edited later. For example, you can reassign a coupon code to another or new campaign by changing the campaign name accordingly when editing a coupon.

Export of voucher data

As described in the chapter ‘Creating vouchers / campaigns’, the voucher codes can be downloaded in CSV format after they have been created. Then you can also use this file in Excel OpenOffice or other programs to prepare it e.g. for printing.

Voucher article

In addition to coupon codes, which are distributed in advertisements or by means of communication, coupons can also be offered for sale in the shop as classic gift coupons.

Create voucher article with given prices

If you would like to offer voucher articles at fixed prices, simply create the corresponding articles, e.g. voucher CHF 50 or voucher EUR 100. This is a normal article. If you send the vouchers with pre-printed, physical media, you may need to add stock information.

Create voucher item with variable prices

If a voucher article is to be set up, where the purchasing customers can then determine the price themselves, this is also possible.

First we create a buyable article in the shop. Here it is important to assign a unique article number to the article, e.g. voucher_variabler_preis. The article must be created with price = 0.00. Select a suitable picture and arrange the article in the category of your choice.

Figure 5: Module administration

For this you have to use an additional functionality of the voucher module. The administration of this function is done in the form of a voucher article module in the shop administration (also included in the scope of delivery of the voucher module). To activate, please proceed as follows:

Shop Administration → Modules → Module Administration

Here, you can install the voucher article module

After successful installation you can confirm it and click on the ‘Back to module administration’ button to return to the overview. There you can now see the Installed Voucher Article Module (see picture on the right). Here you click on the ‘Gift Certificate Articles’ button to switch to the administration for voucher articles with variable price.

The administration screen looks as follows:

Figure 6: Administration mask of a voucher article with variable price

Configuration options

  • Activation: Activation of this module. Attention: If the module is deactivated, the shop will treat a previously defined voucher article as a normal article with price = 0.00
  • Voucher article no.: Here you enter the article no., which signals to the shop, which article should function as a voucher article. This article must have been previously created in the shop administration as a normal article with just this article number. This item must have a price = 0.00 and must not have any stock restriction defined.
  • Show price in name: Should the price of the voucher items in the shopping cart be shown in the name?
  • Voucher minimum value: Do you want to set a minimum value for the voucher? Note: This value should be taken into account when dropdown displaying the number of selections in the item definition. The value = 0.00 means that no minimum limit should be set. This limit is detached from the currency and is used 1:1 for the active currency.
  • Voucher maximum value: Do you want to set a maximum value for the voucher? Please note that this value must not be smaller than the minimum value. Note: This value should be taken into account when dropdown displaying the number of selections in the item definition. The value = 0.00 means that no maximum limit should be set. This limit is detached from the currency and is used 1:1 for the active currency.

How it works

A voucher item is recognized as such if it has the item number assigned, which has been defined in the coupon article module administration in the field “Voucher item number”. This article must be assigned the price = 0.00. The article can have a warehouse stock, but you cannot define a minimum or maximum order quantity for it. This article has no number of input fields. It will be used directly as an allocation of the amount of the voucher. As a customer, you can define the price of the voucher and then only add one voucher at a time to the shopping cart. The number can still be changed there.

Warehouse management: If the article is marked as ‘not reorderable’, it is not possible to define a larger amount in the current currency as the voucher price. This is due to the technical implementation and integration of this special article.

Voucher item processing

Up to now, the voucher article is only passed through with the price defined by the customer when the order is placed, so that a connected ERP system can create the item afterwards. So no coupon code is created and distributed automatically by the shop, this must still be done manually!

Voucher items and VAT

There are two VAT-relevant topics for vouchers, which, depending on the purpose for which the voucher is used differently:

  1. when selling a voucher: VAT rate of the voucher
  2. when using a voucher: the underlying amount from which the VAT component is to be calculated

VAT set choice for voucher items

To the first point: Which VAT rate must be selected for voucher articles? (Voucher article = either according to chapter 4 / voucher article or with a self-created article in the shop, which results in a voucher delivery):

The decisive factor for the taxation of the article is whether the voucher is linked to a specific service (fixed amount, VAT rate predefined), or whether it is not clear from the voucher which services are being purchased. In this case, the voucher will be regarded as a means of payment (amount or percentage reduction, VAT rate unknown, as the service purchase is still unknown at the time the voucher is issued and thus = 0%).


  • Enter VAT rate: Vouchers for a specific service (e.g. “Shopping voucher for a Dinner for two in our restaurant”): The VAT rate is fixed here. The performance is fully compensated with the redemption of the voucher.
  • VAT rate = 0%: “Shopping voucher worth CHF 100”. The voucher purchase is exempt from VAT as it is to be regarded as a (pre)payment. Accordingly, VAT is calculated on the total amount at redemption and not on the final amount to be paid.

The point is that VAT should not be delivered twice to the state. Here is an example: We sell a voucher article for CHF 100 with VAT = 7.7%. The customer now buys an article in the shop, the shop charges 7.7% again. So we got twice 7.7% which is wrong. Since one does not know with many vouchers, how it is used in the Shop - thus it is not known at all which VAT rate combination of the shopping basket with the concrete redemption / shopping will be present, one should put on most coupons with 0%, except it are achievement coupons. Where do I set this? A VAT rate is defined for the article (article processing screen, or in the corresponding field for imports).

VAT amount for tax rate calculation

Second point: With service vouchers, which stand for a concrete service, an item is sold in each case - it is therefore not a voucher in the classical sense. Here we look at the vouchers, which can be used variably: A distinction is made here between two types when creating campaigns:

The ‘Type’ field controls how the voucher is interpreted:

  • Promotion: Here the VAT is calculated on the basis of the price reduced by the voucher: The price of the service is reduced. VAT will only be claimed via the reduced price. Classic use of a voucher in promotions / advertising / marketing.
  • Credit note: Here the VAT is calculated on the basis of the original price (not reduced price): This is applied if the voucher is only understood as a means of payment and the VAT still has to be paid over the complete price - e.g. if the voucher is understood as customer credit.


To use the voucher module, a PepperShop v.3.0.1 Professional or Enterprise is required.

Copy and upload files

The voucher module essentially consists of four files and two directories, which you have to copy into your installed PepperShop. First unzip the included ZIP archive. The following files are included, shown here with the target directories:

{shopdir}/shop/vouchers.php| file
{shopdir}/shop/Admin/shop_gutscheine.php| File
{shopdir}/shop/Admin/shop_vouchers_class.php| File
{shopdir}/shop/Admin/shop_vouchers_func.php| File
{shopdir}/shop/modules/voucher_article| directory
{shopdir}/shop/Admin/module/voucher_articles| Directory

The files can be easily uploaded via FTP or SCP to the web server. The placeholder {shopdir} stands for the shop directory on the web server, where the files index.php and README.txt can be found.

After copying the files, you can go to the shop administration and see the point Marketing > Vouchers displayed.

Log viewer installation

Before we use the vouchers, we have to install the external PepperShop module Log-Viewer, which is used by the voucher module. Therefore we click in the shop administration on the point Module and there on the button, which is titled with Modulverwaltung. Here we click in the left window on log_viewer and at the bottom on the button Install We confirm the course of the installation by clicking on the button Back to module administration.

After installing the Log Viewer, it now appears in the right window, which displays the installed modules. We now return to the main menu of the shop administration: Click on Back to module administration and Back to main menu.

Deactivation of the module

In the file {shopdir}/shop/gutscheine.php there is a control constant called GUTSCHEINE_AKTIVIERT, which is activated by default (true). Here you can turn off this module without uninstalling all files. As editor of the file a program must be used, which can process UNIX line breaks – e.g. Notepad++.

Special remarks / notes

  • If configured, vouchers can also be redeemed multiple times (e.g. a code for a large campaign).
  • If the voucher amount is not completely used up during a purchase, it can still be used with the remaining amount at a later date.
  • Fixed price vouchers Info: Please note that for fixed price vouchers no higher values than the item unit price in the most favorable configuration are indicated! Vouchers bound to items are granted per item. So if a customer buys 5 items, he receives the voucher five times credited on it. This behavior can be adjusted with the control constant by setting it to true. Afterwards the voucher value is calculated distributed on the number of items.

Advanced configuration

Now follows the description of all control constants in {shopdir}/shop/gutscheine.php:

GUTSCHEINE_AKTIVIERT (default = true):
voucher subsystem activation (true = active, false = deactivated, default = true) should always be true.
Should a partial redemption of vouchers be allowed?
Best price determination for items in promotion: true: discount gross price, discount false net price (promotion price). See also below the control constant from the configuration editor (Shop settings - Shop configuration - Configuration - “View and edit control constants of this shop” - Configuration editor): BEST_PRICE_FINDUNG1.
Should an item number binding also apply to all sub-items of a parent item bound to a voucher?
If a fixed-price voucher can only be redeemed if the customer buys at least one item from the category with the specified category number, the voucher should only be used for items from this category and should not be issued as an order voucher. ATTENTION: NO MORE BEST_PRICE_FINDUNG FOR THE AFFECTED ITEMS1
If a fixed price voucher can only be redeemed if the customer buys at least one item with field X = value Y, the voucher should only be used for these items and not as an order voucher. ATTENTION: NO MORE BEST_PRICE_FINDUNG FOR THE AFFECTED ITEMS1
Please note that in the case of fixed price specifications, no values greater than the item unit price may be specified in the most favorable configuration! Vouchers bound to items are granted per item. So when I buy 5 items, I get the voucher credited five times on it. This behavior can be adjusted with this constant by setting it to true.
problem: Vouchers, which are assigned with a lower value on an item total, must decide whether the voucher may be applied. The item total stored in the item_order is used for comparison purposes - the voucher is then granted (if applicable) and the item total is reduced accordingly. At the next run the same will be calculated again (but now with the item total reduced by the voucher value). Depending on the constellation, it may be that the total number of items is now too small and the voucher is no longer granted. The total amount of the article is saved again (now without voucher deduction). The voucher is granted again during the next invoice run (flip-flop). To prevent this, you can set GUTSCHEINE_ARTIKELTOTAL_AUS_BESTELLUNG_BERECHNEN = true. However, this is a temp. solution, as it does not harmonize with other discounts. The total article calculated here does not take into account (other) article discounts and also no total article discount from rabatt_func.php. Thus the comparison value is not correct in every case!

Now follows the description of the control constants in the configuration editor (Shop settings - Shop configuration - Configuration - “View and edit control constants of this shop” - Configuration editor):

If activated, voucher discounts are distributed proportionally to the items in the shopping basket. Items being promoted are discounted starting from the gross price. complex logic! See for details also explanation in the file {shop_directory}/shop/gutscheine.php is mainly used in combination with the control constant GUTSCHEIN_ANTEIL_AUF_BRUTTOPREIS_ANWENDEN.

Online Help

In the vouchers main menu, you can access the online help texts for the voucher module (HTML help, PDF module instructions, voucher items help texts) by clicking on the help button.

  1. Best price determination is a module that allows pricing linked to action chains. The control constants GUTSCHEINE_BEST_PRICE_FINDUNG and GUTSCHEIN_ANTEIL_AUF_BRUTTOPREIS_ANWENDEN can also be used without this module. ↩︎