New Module - Referral Discount for Drupal Commerce

Nikhil Banait   |  17th October, 2016

One of the popular Growth hacking technique for e-commerce and SaaS businesses is Referrals, which is to leverage your user's network to get new users by offering incentives / discounts. On a recent e-commerce project we had the requirement to create a complete referral system but couldn't find a module that came close to fulfilling the requirements, hence we developed and contributed Commerce Referral Discount. This module allows us to provide a discount credit to an existing user for referring new users. Discounts can be configured for both the referring user and the new user who joins as part of the referral. Lets see a typical flow:

  • User A invites user B to signup on website using a unique invite URL (http://yoursite.com/invite/username).
  • User B visits the site using this URL, and is taken to the registration form to create a new account.

  • User B gets some discount amount (say $5) which he could use on his first purchase.

referral discount on order

 

  • After user B makes his first purchase, user A gets a discount amount (say $10), which could be used in the next purchase.

  • Both discount amounts are configurable from the admin backend.

Module Configuration:

  • To configure the discount amounts browse to /admin/config/referral-discount
discount amount configuration

 

  • Configure referral discount on product purchase at Administration » Store settings » Promotions » Discounts:

    • Go to admin/commerce/discounts page.

    • Click on "Add discount" button.

    • Choose discount type : Order discount

    • Choose offer type : Referral Discount

    • Now click on Save discount.

referral discount type

 

  • Configure Invite/Referral Link block

    • Visibility settings: Show block for authenticated user.

Commerce Referral Discount module provide "Invite/Referral Link" block, which contains unique refer/invite link for authenticated users to share across their friends. 


The module also integrates with views:

  1. It provides a view type 'Commerce Referral Discount' which can be used to list down all the discounts and other data which it stores in the 'commerce_referral_discount' table in database.
  2. It also provides relationship to the user entity, so you can also include the data of Referrer user and Invited user.

 

    Looking for a Drupal partner ?

    We are drupal 8 ready