Skip to main content

Customizing and designing gift voucher templates

Installing the gift voucher plugin creates a new document template for gift vouchers. This document template can be customized or duplicated as many times as needed to create different document templates, e.g. with different voucher formats and voucher designs. Below you'll learn how to make these customizations.

Note: To prevent your voucher templates from being overwritten by the default template during a plugin update, copy the .tpl file (e.g. coupon.tpl) into the folder /themes/Frontend/Bare/documents and make your customizations to the copy.

Customizing the default document template

Under Settings → Grundeinstellungen (Basic Settings) → Shopeinstellungen (Shop Settings) → PDF-Belegerstellung (PDF Document Creation) you can edit the document template for gift vouchers. In the Elemente (Elements) section, the following areas can be customized:

  • the address of the online shop (Voucher_Shopinfo)

  • the logo of the online shop (Voucher_Logo)

  • the note about redeeming the voucher (Voucher_Redemptioninfo)

  • the redemption conditions (Voucher_Redemptionconditions)

  • the image on the front of the voucher (Voucher_Coverimage)

  • the image on the back of the voucher (Voucher_Backimage)

  • issue date and sequential voucher number (Voucher_Date_And_Serial)

  • the validity date of the voucher (Voucher_Valid_To)

image16.png

Please also note the following:

  • Folded, the voucher measures about 15 x 11 cm. To be able to print at 180 DPI, you should use an image with a resolution of at least 1100 x 800 pixels for both the cover image and the image on the back.

  • You can customize the text Gutschein (voucher) in the title and the note Wert in € (value in €) under Settings → Textbausteine (Text Snippets) → Namespaces → documents → viison coupon → coupon.

    image11.png

  • The settings for spacing, items per page, and page breaks are not interpreted in the default template. You can find more information on PDF document creation here.

You can check saved changes using the Vorschau (Preview) button.

Possible customizations at the subshop level

You can customize the contents of the gift voucher document at the subshop level. To do this, click on the globe icon under Settings → Grundeinstellungen (Basic Settings) → PDF-Belegerstellung (PDF Document Creation). There you can select the individual subshops and customize the elements accordingly.

image14.png

Using your own document template

Creating your own document templates is not covered by this guide, so the necessary procedure is only explained at a basic level below.

Custom templates must be selected via the Template field within the document template configuration (default: coupon.tpl). The template variable $ViisonCoupon gives you access to the voucher information within the template. The variable contains an associative array with the following structure:

.coupon.value

integer voucher value in euros

.coupon.code

voucher code

.coupon.barcodeData (optional)

voucher barcode as SVG, base64-encoded for use in a data URL

.coupon.isSoldVoucher

true, if it is a gift voucher generated as an order document

.generation_date

creation date of the document

If $ViisonCoupon.coupon.isSoldVoucher has the value true, the sequential number of the document can be read from $Document.id.

Did this answer your question?