Plugin: Bonus System

Introduction

The bonus system of Shopware offers you the possibility to credit bonus points to customers as an incentive to revisit to your shop.

Bonus points are calculated by the shopping cart value using an adjustable factor which can be defined in the backend. The customer can then redeem these bonus points for defined items in your shop. Additionally, the customer has the option of allocating points in a voucher. The conversion factor for this can also be defined in the backend.

The bonus system is also capable of supporting subshops. You can define different bonus items and conversion factors for each language- and subshop. You can also decide whether each shop have the bonus system active or not.

The bonus system is only usable for customers with an account in your shop. Quick orders without creating an account cannot receive bonus points. As shop operator, you should deactivate the option for quick orders or hint at this.

Installation

This extension can be found in our Shopware Store, the easiest way to find a specific plugin is the search-bar. Complete the order process and login to the backend of your store. Navigate to Configuration > Plugin manager > My purchases. You need to login and click the refresh button. Your new extension is now listed and can be installed. After installing the extension go to the menu entry installed and refresh. Activate the extension. Finally delete the cache under Settings > Cache/Performance > Clear Shop Cache and refresh the backend.

Email templates

If you want to show the bonus points in the order confirmation email, you have to customize the sORDER email template. Just go to Configuration -> Email templates and edit the sORDER template. In "Plaintext" you can find the following lines:


 
{$details.price|padding:8} EUR 
{$details.amount|padding:8} EUR		
 

Replace those lines with the following code:


 
{if $details.isBonusArticle}
   {$details.points_per_unit|padding:8} points
   {$details.required_points|padding:8} points
{elseif $details.isBonusVoucher} 
   {$details.required_points|padding:8} points
   $details.price|padding:8} EUR 
{else}
   {$details.price|padding:8} EUR 
   {$details.amount|padding:8} EUR	
{/if}
 

In the HTML text field you can find the following lines:


 
   <td>{$details.price|padding:8}{$sCurrency}</td>
   <td>{$details.amount|padding:8} {$sCurrency}</td>
 

Replace those lines with the following code:


 
{if $details.isBonusArticle}
   <td>{$details.points_per_unit|padding:8} points</td>
   <td>{$details.required_points|padding:8} points</td>
{elseif $details.isBonusVoucher} 
   <td>{$details.required_points|padding:8} points</td>
   <td>{$details.price|padding:8}{$sCurrency}</td>
{else}
   <td>{$details.price|padding:8}{$sCurrency}</td>
   <td>{$details.amount|padding:8} {$sCurrency}</td>
{/if}
 

Additional variables

  • {$additional.sBonusPoints.spending} -> spent points
  • {$additional.sBonusPoints.remaining} -> leftover points
  • {$additional.sBonusPoints.earning} -> Amount of points get for the order
  • {$additional.sBonusPoints.user} -> Amount of point before the order

Functions of the plugin

In this section we'll explain the backend module of the Bonus System Premium Plugin.

At opening the module, the home page of the bonus system will be shown which lists all the functions of the plugin. With these four areas, the functions of the bonus systems are fully covered for the respective shop. Consider, that these are valid only for the selected shop!

On the left side there is a list of available functions:

  • Settings (1)
  • Users (2)
  • Bonus Articles (3)
  • Articles (4)
  • Categories (5)
  • Special offers (6)
  • Orders (7)

Before you set any options, please select your shop (1) first.

Settings

In this area you can find the various bonus system settings, which are divided into three areas:

General

In the General area the following options are available:

  • Activate service mode (1)

When the service mode is enabled, the whole frontend functions of the module will be disabled and hidden. The shop itself is still accessible.

  • Activate bonus products (2):

If this is active, bonus articles will be displayed in the frontend.

  • Conversion factor bonus points (3):

This is the conversion factor at which the customer receives a bonus point. Bonus points do not include shipping costs, but cart surcharges.

  • Activation of bonus points (4):

Here can be defined, when the bonus points will be unlocked. When you're using "If order is paid", the points were directly activated when you set the payment state "Komplet bezahlt" / "completely paid", but at least at the cronjob run. See the help text in the elements for additional information.

"When order is payed" refers to the payment state "komplett bezahlt" of the respective order!

  • Rounding bonus points (5):

Here you can define how bonus points are rounded.

  • Days until activation (6):

Here you can set the delay for credit the bonus points. The activation is performed via cronjob and only, if you have the activation method After x days of the order. This function requires the plugin Cron to be installed and active. Then the cronjob SwagBonusSystemCron can be executed as often you want.

  • Encash point on checkout confirm page (7):

If you activate this function, your customers can redeem bonus points in the checkout too.

  • Consider voucher bonus points (8):

Vouchers can be affect the counting of the bonus-points if this setting is enabled.

  • Bonus points calculation mode (9):

Here you can define, whether you want discounts and surcharges to be considered at the calculation of th ebonus points or not.

  • Exclude customer groups (10):

Here you can exclude customer groups from the bonus program.

  • Automatic bonus points deduction for cancelled orders (11):

This checkbox allows you to specify whether bonus points should be posted back to the customer's account when an order is cancelled.

  • Applied to status (12): 

With this option you can determine which status the order must reach in order for the bonus points to be posted back to the customer's account.

  • Consideration time (Cronjob) (13): 

Orders placed after this time will be included in the points cancellation process.

 

The cronjob feature allows an automatic processing of various functions. At the installation the new cronjob was added to the default cronjob list of Shopware. If you are already using cronjobs, no further adjustments are required.

Debiting bonus points

In this area the following options are available:

  • Activate debiting (1):

Is this item is enabled, the customer can exchange the bonus points in their shopping cart for euros. Shopware automatically generates a voucher and adds it to the shopping cart.

  • Conversion factor (2):

The factor for the conversion of bonus points is defined here (like in General). Unlike the General area, you can define here how many points are equal to one euro. Note that the minimum value for redeeming bonus points must be at least 1 euro. Only from this amount the counter appears in the frontend (shopping cart).

  • Type of debiting limitation (3):

The conversion of bonus points in euro can be restricted here. You can enter a fixed euro amount or determine the restrictions relative to the order value.

  • Value of limitation (4):

Here the euro amount for the restriction is entered.

Template

In the template area the following options are available:

  • Text for bonus product listing (1):

This text will be displayed in the listing of the bonus items in the frontend.

  • Show banner (2):

Since the upload field don't support the display of existing data and/or images, the banner can be deactivated here. When uploading a graphic file, it will be transferred to the server in the background.

  • Display accordion (3):

If this point is enabled, the bonus article accordion appears on the home page and the category listing. Visually, this corresponds to the manufacturer accordion on the right side of the home page of your shop. This function is shopping world compatible.

  • Display bonus product slider (4):

If this item is enabled, the bonus article slider will be shown in the shopping cart and on the home page (also in combination with shopping worlds).

  • Banner for bonus product listing (5):

The upload field does not support any existing graphics. So you can only upload graphics initially, or overwrite existing graphics later.

  • Template-Selection (6)

This setting defiens which listing appears in the frontend when opening http://mydmain.com/BonusSystem.

Users

In this tab, you can see all the bonus points of your customers and manually edit them by double-clicking (1). As soon as the adjustment of points is completed, the changes can be updated by clicking the Update button (2).

Bonus Articles

In this tab you can add al the items you want to sell for bonus points. ust go to the search field (1) and add the item. After adding the item you can set the number of bonus points (2), which are required to buy the item for bonus points.

Now the customer can buy these items for bonus points (1).

Articles

Here you can exclude items from bonus points. If the customer buys this item, he won't get bonus points for it. Over the search interface (1) you can search items by name and ordernumber. (You always define base items. If your item uses variants, each variant is available for your defined bonus points.)

Categories

Here you can set categories, which were excluded from bonus points. Just search for the category name in the search interface (1) and add it. Your customers won't get bonus points for buying items from this categories. The items in the category can also no longer be defined as bonus items.

Special offers

This option offers you the possibility to set deviant bonus points. Just search (1) for the item you want and add it, then choose the offer type (2):

  • Fix - Here the item will be set to a fixed value (3) of bonus points the customer can gather for this item
  • Multiply with - At this offer type the default bonus points will multiplied with the offer value (3).

Moreover you can set offers for a limited time (4)

Orders

This tab lists all existing orders since the activation of the bonus system. This applies also to the Number of bonus points (1) that the customer receives for his order. Using the Search (2) in the toolbar, specific orders can be found quickly and easily. Via the icons Open customer & order(3) you can jump directly to the appropriate interface.

Activate bonus points manually

Select (4) the desired orders and click the button Approve selected (5).

Elements in the front and backend

Once the bonus system of Shopware is enabled, new items can be found in the frontend.

Accordion

If you have defined and activated bonus articles, an accordion with the first five articles will now appear on your home page. These are sorted on the field 'Position'. At the end of the accordion is a link "Show all" which guides the user to the listing of the bonus articles.

Article slider

In addition to the accordion an article slider with all bonus items will be shown in the shopping cart and on the home page. This can be disabled is the backend.

My Account

Once the user is logged, the User bonus points (1) is displayed next to My Account.

Clicking on You have X bonus points causes two links to appear, Bonus articles and User bonus point account (2).

If the user has put an article in the shopping cart, Bonus points for the current shopping cart (3) is displayed in the header section of the page.

Listing all bonus articles

A new listing for bonus articles was added (www.yourshop.com/BonusSystem), which displays all bonus articles defined in the backend. If the user is logged in, the points for the article appears green if he had already collect enough points. Should the user have not enough points for the article, the remaining points are displayed in red in the row beneath.

Detail page

In order for the user to see how many points an article is worth, a new element (1) has been added below the "Buy" button.

To distinguish whether the article will be bought for money or bonus points, two radio buttons have been added over the "Buy" button. The shown points represwents the equal price per unit.

Shopping cart

  • As in the header, the bonus points are also displayed in the shopping cart over the order positions table.
  • Articles which were purchased for bonus points, are displayed here with a special mark (2).
  • For converting bonus points into money, a jQuery has been implemented into the UI. The user can easily determine the value by adjusting the slider control (3).
  • Keep in mind that the Slider (3) will only be displayed, when the equal points reach at least 1 Euro.
  • Below the shopping cart sum, a new element has been added which is responsible for displaying the issued points (4).
  • As the bonus articles the accounted bonus points will displayed in the item list with a special mark(1) is displayed in a separate listing with a special symbol.
  • Additionally, another bonus article slider is located below the "Proceed to checkout" button, as it is displayed on the home page. Here the customer can see again what they are able to buy for their bonus points. This slider can be hidden in the backend module.

Email

If you have configured your email template as described in the plugin installation, the bonus point sum is also displayed there.

Account

Another point has been added to the My Account section called My Point Account. All orders from which points were collected are displayed here. The points for the with points redeemed positions are also shown in the grid "My orders". Here the customer can see status of activation of bonus points (2).

Integration of the bonus system components

Before the components are individually linked into the template, a test is recommended, whether the bonus system and the bonus articles are activated:


 
{if $sBonusSystem.settings.bonus_articles_active && $sBonusSystem.settings.display_article_slider==1}
    -- Desired components (see below)
{/if}
 

Accordion:


 
{include file='frontend/plugins/swag_bonus_system/accordion/accordion.tpl'}
 

Article slider with bonus articles:


 
{include file="frontend/plugins/swag_bonus_system/recommendation/slider.tpl"}
 

These examples are only possible extensions, it's not necessary to implement this after a default installation.

Was this article helpful?