Rewards

Time to read: 7 minutes


PepperShop can be extended with the rewards module, so you can offer reward products starting at specific purchase sums. A rewards communication channel is available so customers are informed about this offer at an early stage.

Usage of the Rewards System

Rewards Product Description

Reward products are standard PepperShop products, but there are important restrictions that must be adhered:

  • The product price must be = 0.-
  • The weight of the product must be = 0
  • No options / variants / text fields may be used
  • Do not use linked option products (manual cross-selling)
  • Do not use parent / sub product constructs

Further definitions, which define a reward product:

  • A price limit must be specified in additional product field 1 (in basic currency). Only when a shopping cart value at least equal to this price limit has been reached, does the shop show the corresponding rewards to the customer.
  • Category assignment: A reward product may only be assigned to the corresponding rewards category.

Create Reward Product

Here is a small example how to create a reward product:

Figure 1: Input mask 'New product'

Figure 2: Page 2 of the input mask

In the shop administration we click on ‘Product’ > ‘Insert new product’. There we enter a product number, a name for the product as well as a price of 0.00 and a weight of 0. Then we click on ‘Next’. This product will then be assigned to the rewards category. In this example we only have one category called ‘reward products’. A product image is optional.

Now we go from the main menu of the shop administration to ‘product’ > ‘mass mutations’ > ‘additional product fields’ and define the price limit for it to be available for the customer.

Figure 3: Mass mutation of additional product fields

Sample screenshot.

Example of a Rewards Selection

Figure 4: Rewards display in the order overview

Whether the reward product contents are displayed expanded or not can be adjusted with PHP knowledge via the following file:

  • File: {shop_directory}/shop/praemien.def.php
  • Member variable: $praemien_ausklappbar = true | false;

Advertising of Available Reward Products

The selection of the reward product is only possible after checkout, during the order overview. This is a little late to tell the customer that ‘only amount X is missing until he can select the next higher reward’. In order to be able to display this information to the customer as soon as he has placed something in the shopping cart, reward advertising is used. It consists of a table which can be managed in Excel or LibreOffice Calc and HTML template files which are displayed to the customer.

In order to use reward product advertising, it is necessary to first activate this mechanism globally for the shop. This is done by setting the control constant SHOW_PRAEMIEN_KOMMUNIKATION_MESSAGES = true in the file {shop_directory}/shop/config.inc.php (or via configuration editor).

Definition of The Price Intervals and Their Display File:

First you define entries in the file {shop_directory}/shop/Admin/preis_message.csv which define up to which shopping cart value which HTML file is displayed to the customer as an info message (depending on the currency).

Figure 5: Sample content of file preis_message.csv

The specified file can be downloaded e.g. via (S)FTP and edited in Excel and then uploaded again, or you can use an editor to edit the file directly on the server. The semicolon (;) is used as the CSV delimiter.

Example 1

If you offer a reward product in your shop starting from 500.-, then you would use e.g. the following contents in the preis_message.csv file:

In the first column ‘Ab Preis’, you enter the minimum amount that customers need to have in their shopping carts. In the second column ‘Waehrung’ you define the currency, e.g. USD for United States Dollars. In the last column “Message Datei” you enter the name of the html template file to be displayed to the customers.

Example 2

In a second example, we see a shop that sells only in Swiss Francs (CHF), but has several reward product intervals:

The last interval is intended to always remain displayed.

Figure 6: Another sample content of file preis_message.csv

Important: Choose the price intervals in the same way as specified for the reward products (additional product field).

Creating and Editing Advertising Message Files

As the price intervals are defined now, you can create the indicated HTML files in the directory {shop_directory}/shop/language/{language code}/content. E.g. if you click on ‘My content’ > ‘Edit content’ > ‘Create new page’, enter a file name (e.g. price_message_1) and click on the button “create”.

The content of the page can now be edited by clicking on the button “edit” in the list.

The following variables are available in the advertising message file. They are replaced at runtime with the current values of the purchasing shop customer:

  • {waehrung} → Currency currently used by the shop customer (e.g. CHF, US\$, …)
  • {diff_betrag} → Amount still missing until the next reward level is reached.
  • {wk_betrag} → Current amount of the shopping cart

A sample content could look like this: “If you buy for {waehrung} {diff_betrag} more, you get a free reward!”

Installation

System Requirements

To be able to use the rewards module, a PepperShop Professional or Enterprise is required. This module is optionally available for the PepperShop and must be purchased separately.

Copy and Upload Files

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

{shopdir}/shop/praemien.def.php
{shopdir}/shop/praemien_kommunikation.def.php
{shopdir}/shop/language/html_templates/praemien.tpl.html

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

Now the module is recognized by the shop and displayed in the shop configuration.

Initial Configuration

Figure 7: Category management: Create a new category

In order to be able to create reward products in the shop, you must first create at least one category in which the reward products are stored. If the shop is run by the customer in multiple languages, then you usually create a reward category for each language - e.g. rewards_de, rewards_en etc.

All reward categories must be invisible. The visibility is set in the category management when editing ‘Settings of a category’ (visibility → remove tick!).

In order for the category to contain reward products, you have to add the following text to the category in the attribute ‘special’:

praemien (please copy from here)

Now the installation is finished and you can see in the category management that the edited category(s) are marked red.

If the additional product field 1 is not already used elsewhere in the shop, the reward system is now ready for use. You can now enter products and assign them to the reward category(s). If the first additional product field is already in use, you must assign another additional field to the reward system. How this works is explained in the following chapter.

Costumizing The Reward System

The following chapters explain how to adjust the reward system.

Costumize Control Variables of The Reward System

In what additional product field is the price limit stored?

Edit the file shop/praemien.def.php and adjust the following settings:

var $ab_preis_artikel_zusatzfeld = 'zusatzfeld_1'; // Which additional product field contains the reward price limit (minimum price, from when this reward is made available for selection) (Default = additional field 1 -> 'zusatzfeld_1')
var $kat_special_name = 'praemien'; // What is the 'special' field entry for categories to link them to this module (default = 'praemien')

Recode Display Control

By default, the shop displays reward products depending on the amount in the shopping cart of a shop customer. If you want to change this, you can do so with some knowledge of PHP. To add other reward availability rules, just extend/adapt the first praemien method filter_verfuegbare_praemienartikel() in praemien.def.php.

Change Rewards Selection Mask

Figure 8: Sample display in the shop

The display of the rewards selection mask can be adapted in the HTML template file {shopdir}/shop/language/html_templates/praemien.tpl.html. Attention: Make sure to create a backup beforehand.

🌶️
🔥
🌶️