My Cart 0

User Manual - Refer a Friend

Magento 2 Refer a Friend extension allows creating effective customer referral programs beneficial for all the sides, including Magento merchants, brand advocates, and newly attracted customers. The module includes multiple configuration and management options both on backend and frontend that make it possible to tailor programs to particular business needs, track and improve certain program aspects making it even more valuable for all the participants.

API documentation link

 

 

Installing Refer a Friend

Command Line Installation

  1. Backup your web directory and store database
  2. Download the Refer a Friend installation package
  3. Upload contents of the  Refer a Friend installation package to your store root directory
  4. In SSH console of your server navigate to your store root folder:
cd path_to_the_store_root_folder

run the following command:

php bin/magento module:enable Aheadworks_Raf

php bin/magento module:enable Aheadworks_RafGraphQl

then:

php bin/magento setup:upgrade

after:

php bin/magento setup:static-content:deploy -f

     5. Flush store cache; log out from the backend and log in again

Make sure the installation is done from under the FTP administrator account. Otherwise, make sure to set 775 permissions to the store root directory after the extension is deployed.

Composer Installation

If you are installing an extension from Aheadworks for the first time, you need to add our composer repository to your Magento store:

     1. Login to your ssh console and navigate to your store folder:

cd path_to_the_store_root_folder

Run the following commands:

composer config repositories.aheadworks composer https://dist.aheadworks.com/

After the command was executed successfully, you can use the composer

To install the extension:

     2. Login to your ssh console and navigate to your store folder:

cd path_to_the_store_root_folder

    3. Run the following command to install the latest version of the extension:

composer require aheadworks/module-raf

if you need to install a specific version, run this command:

composer require aheadworks/module-raf:<version>

 

Specify the version of the extension in <version>

When prompted, enter Public Key (Username) and Private Key (Password):

 Public Key (Username) and Private Key (Password) | Refer a Frined for Magento 2

Both Public Key (Username) and Private Key (Password) can be found in My Projects and Licenses in your personal account on our site:

Need to use with Klarna payment method?

Make sure the official module of the payment gateway is installed and proceed with a corresponding command:

composer require aheadworks/module-raf-klarna (for Magento 2.3.* and 2.4.3 and below) 

composer require aheadworks/module-raf-mm-klarna (for Magento 2.4.4 and above)

 Run the following command to install Refier a Friend GraphQl: 

 composer require aheadworks/module-raf-graph-ql

 

4. Enable the extension:

php -f bin/magento module:enable <Module_Name>

php -f bin/magento module:enable Aheadworks_RafGraphQl composer

 

Add the product name in <Module_Name>

Need to use with Klarna payment method?

Make sure the official module of the payment gateway is enabled and proceed with a corresponding command:

bin/magento module:enable Aheadworks_RafKlarna (for Magento 2.3.* and 2.4.3 and below) 

bin/magento module:enable Aheadworks_RafMmKlarna (for Magento 2.4.4 and above)

Next, register the extension:

bin/magento setup:upgrade

Recompile your Magento store if you are in the Production mode:

bin/magento setup:di:compile

To verify that the extension is enabled, run this command:

bin/magento module:status

Clean store cache, by running the following command:

bin/magento cache:clean

Log out and Log in the backend again.

To upgrade the extension:

     5. To update or upgrade an extension:

Download the updated extension file. Take note of the module-name and version. Export the contents to your Magento root.

If a composer package exists for the extension, run one of the following.

Update per module name:

composer update aheadworks/module-raf

Updater per version:

composer require aheadworks/module-raf:<version>

<p>Run the following commands to upgrade, deploy, and clean the cache.

 

php bin/magento setup:upgrade --keep-generated
php bin/magento setup:static-content:deploy
php bin/magento cache:clean

 

Installing Hyvä Theme Compatibility Module

Starting from Refer a Friend version 1.4.5 and its Hyvä Compatibility Module version 1.1.0, the Hyvä Compatibility Module is available only via the Aheadworks Composer repository.

Older versions of the Hyvä Compatibility Module can still be accessed via GitLab.

Installing Hyvä-compatibility module 1.1.0 and newer 

To install Hyvä Compatibility Module 1.1.0 or newer via Aheadworks Composer, run the following command:

composer require aheadworks/module-raf-hyva

Installing older versions of Hyvä-compatibility module

To install an older version of the Hyvä Compatibility Module, use the following command:

composer require hyva-themes/magento2-aheadworks-raf

Hyvä-compatibility Modules with CSP Compliance 

Starting from Hyvä Compatibility Module version 1.1.0, all Hyvä compatibility modules are CSP compliant. Older versions remain non-CSP compliant.

Note: The CSP-compliant modules may not be compatible with older versions of Hyvä Theme (1.3.9 and older). Before updating, please verify which version of the Hyvä Theme your store is using.

 

Installing ShareThis

After the extension installation, you can add the ShareThis social bookmarking services to your store in order to facilitate the whole process of sharing for your brand advocates.

1. Create your ShareThis accounts:

2. Follow the provided instructions to add your site to the services. In case you have one of these services working in your store, there is no need to do anything. The functionality will be engaged automatically.

3. As soon as everything is set and launched properly, your brand advocates are able to share their individual referral links via the ShareThis buttons from their customer accounts and across the entire store.

 

Set up cron

The Refer a Friend extension uses cron for automatic balance checks and customer notifications.

If you have already configured cron jobs for your Magento installation, then you can skip this step. Read the following instructions on setting cron job for your Magento store: Magento user guide.

Generally, it will be enough to run in the SSH console of your server the following command: 

crontab -e

And insert the following line:  

*/3 * * * * php -c <ini-file-path> <your Magento install dir>/bin/magento cron:run
*/3 * * * * php -c <ini-file-path> <your Magento install dir>/update/cron.php
*/3 * * * * php -c <ini-file-path> <your Magento install dir>/bin/magento setup:cron:run

Don't forget to confirm saving request when exit.

Uninstalling Refer a Friend

Since Magento introduced declarative Database you need to be very carefull when uninstalling or disabling the module.

NOTE: Please be very careful when uninstalling/disabling this module. This module uses a declarative DB scheme. Once the module is uninstalled the DB tables will be lost.

Manual Removal

1) Run command: 

bin/magento module:uninstall --non-composer Aheadworks_Raf

It will remove hide price attributes from the system (e.g. eav_entity_type table).

2) Disable extension: 

bin/magento module:disable Aheadworks_Raf

3) Run setup upgrade: 

bin/magento setup:upgrade

It will remove module related tables from the system (hp_rule_entity, hp_rule_product, etc).

4) Remove module files manually: 

app/code/Aheadworks/Raf

Automatic Removal (via Composer)

1) Disable extension:

bin/magento module:disable Aheadworks_Raf

2) Run setup upgrade: 

bin/magento setup:upgrade

3)

php bin/magento module:uninstall Aheadworks_Raf

4) For completely removing the extension, please proceed with the command:

bin/magento module:uninstall --remove-data Aheadworks_Raf

 

 

Extension compatibility

Module Version 

Magento Version 

1.1.6  and earlier versions

2.3.Х - 2.3.6

2.4.0 - 2.4.3

As of version 1.1.7

2.3.7-p3+

2.4.0 - 2.4.4

As of version 1.2.0

2.3.7-p3+

2.4.0 - 2.4.5

As of version 1.2.1

2.4.3 - 2.4.5

As of version 1.2.2

2.4.4 - 2.4.6

As of version 1.4.1

2.4.5 - 2.4.7

As of version 1.4.4

2.4.6 - 2.4.8

The PHP version depends on your current Magento version. Please, refer to your Magento version release notes.

 

Introducing to Magento 2 Refer a Friend

Extension Overview

The Refer a Friend extension for Magento 2 is designed to drive sales through customer referral programs. It distinguishes itself by offering a balanced reward system where both the brand advocate (the referrer) and the new customer (the friend) receive incentives. The module provides detailed rule explanations for both customers and staff, ensures GDPR compliance, and tracks comprehensive statistics to monitor program performance.

Key Features

  • Rewards available for both brand advocates and new customers;

  • Integration with AddThis and ShareThis;

  • Rules explained in details for brand advocates and Magento staff;

  • Statistics available for individual brand advocates and general data tracking for Magento admins;

  • GDPR compliance (right to be forgotten).

 

Integrations 

Using Magento 2 Refer a Friend

Extension Configuration 

The Configuration section is the first step to take when you start using the Refer a Friend extension. Please enter it following Stores → Configuration → AHEADWORKS EXTENSIONS → Refer a Friend → Configuration.

The section consists of two blocks: General and Email Options. The General block makes it possible to set up general settings of the extension as follows below.

General Settings

  • Who Can Invite Friends – Defines eligibility for brand advocates. Options include:

    • All Registered Customers – Any logged-in visitor can participate.

    • Only Registered Customers with Previous Purchases – Only those with an order history can enter the program.

  • Order Status – If restricted to previous purchasers, this defines which order statuses qualify a customer.

  • Customer Groups Which Can Join Referral Program – Restricts access to specific Magento customer groups to avoid distracting irrelevant segments.

    • Note: The 'Not Logged In' group is excluded from this selector.

  • Order Status to Give a Reward to Advocate – Specifies when the advocate receives their reward based on the friend's order status.

  • Holding period – A numerical value in days defining the delay before rewards are granted. This is recommended to prevent rewards for subsequently canceled orders. In case if '0' is set or the field is left empty, rewards will be given instantly once orders obtain the appropriate status.

  • Maximum RAF Discount Which Can Be Applied to Subtotal, % – Use during the checkout by providing the maximum discount allowed per one order.

  • If Unused, Earned Discount Expires in, days - Use this configuration option to motivate brand advocates to actively spend their rewards. 

  • Allow Applying Subsequent Discounts – Determines if referral discounts can be combined with other loyalty program discounts. Disabling this helps protect profit margins.

  • Static Block for Welcome Popup – Selects a Magento static block to display as a welcome message to newly referred visitors. The popup is disabled if no block is selected.

  • Sandbox mode – Disables IP validation for testing purposes. It is recommended to use different browsers for testing the advocate and friend journeys.

General Settings | Refer a Frined for Magento 2

 

Email Options allow you to configure the notification system of the extension.

  • Email Sender – Specify the email address acting as the sender of all email notifications.

  • Email template of Notification About New Friends Reward – Defines the template to be sent to brand advocates about their new rewards.

  • Expiration Reminder Email Template – Set up the email template notifying brand advocates that their rewards expire soon.

  • Email Template of Notification About Reward Expiration – Defines the template for notifications telling brand advocates that their rewards have been expired.

  • Enable Admin Emails Sending – Set to Yes to allow emails to be sent to Admins once an invited customer places an order.

When Enable Admin Emails Sending is set to Yes, the following options appear:

  • Admin Email Address - fill in Admin email adress where the emails should be sent.

  • Admin Notification’ Email - the default admin notification email template includes the following information: Advocate Name, Advocate Email, URL to the Advocate Account, Friend Name, Friend Email, URL to the Friend Account, Order number, URL to the Order.

Refer a Friend is delivered with some default templates. You can use and customize them or add your own ones.

 

Rules

The Rules section is located along the following path: Marketing > Refer a Friend by Aheadworks > Rules.

Rules Grid

Each refer-a-friend rule is applied to one Magento website. So, in case if you manage one website, the module doesn't display the Rules page and grid. Instead, it redirects your immediately to the rule editing page. But, if you have several websites in one Magento installation, you can create a separate rule for each of them.

The Rules grid contains 4 columns:

  • Rule name - A custom rule name implied to distinguish it from other rules;

  • Rule Status - The column shows whether the rule is enabled or disabled;

  • Website - The website a particular rule is assigned to;

  • Action -The column allows you to delete or edit rule right on the spot.

The Rules grid is a Magento 2 grid so it allows you to sort and filter grid attributes, customize its view, etc. On this page, you can also create a new rule using the Add Rule button.

Rules Grid

 

Rule Editing

The rule editing page contains the following configuration options:

  • Rule Name - The text field to be filled with a rule name;

  • Rule Status - The box allows you to enable or disable the rule;

  • Website - The multi-selector to assign the rule to a particular Magento website;

  • Apply to Shipping Amount - The toggle switch button that allows you to choose either applying rewards and discounts to shipping charges or not.

Rule Editing | Refer a Frined for Magento 2

 

Rule Conditions

Rule conditions are provided on the same page in a human-readable form. The conditions of the rule can be changed by clicking on the words highlighted with bold font:

Rule Conditions | Refer a Frined for Magento 2

  • Customer Registration – Set whether friends registration is mandatory to get the discount on their first purchase. We recommend you to set it mandatory in order to avoid the chance that one customer receives several discounts.

  • Friend Discounts – Set the discount amount and choose whether it is fixed or % of its first order (see the image above).

  • Brand Advocate Rewards – As in the case with friend discounts, these discounts can be either fixed of %. In the case of a percent discount, it is recommended to set the option "Maximum RAF Discount Which Can Be Applied to Subtotal, %" in the General configuration to a reasonable amount, for example to 15%. In this case, even if an advocate has a lot of friends and earned a huge discount, they will not be able to apply more than 15% at a time.

In order to make the 'Referral Program' tab visible to customers in their accounts, you need to configure at least one rule.

 

Advocates


The Advocates section can be found as follows: Marketing → Refer a Friend by Aheadworks → Advocates.

 

Advocates Grid

The main page of the section contains the Advocates grid and referral program performance statistics.

The Performance area of the page contains two indicators. 

  • Quantity of Orders Made by Friends displays the share of orders made by friends in % out of the total number of orders in the store for last 30 days. 

  • Total Amount Made by Friends is the same indicator related to the monetary value of friends' and all website orders.

 

The Advocates grid comprises the following columns:

  • Advocate Name - contains customer names;

  • Email - contains customer emails;

  • Web Site - displays the web site a customer operates in;

  • Invited Friends, Total - shows the number of invited friends by this particular customer;

  • Current Balance - balances of rewards earned by brand advocates;

  • Nearest Expiration Date - displays the dates of reward expirations.

  • Action - contains active links to Advocate Information pages.

 

Advocates Grid | Refer a Frined for Magento 2

 

Advocate Information Page

The Advocate Information Page contains two distinct areas: 

  • Summary - This area allows you to track the performance of individual brand advocates, including their number of invited friends, current reward balances, and nearest expiration dates.

  • Transactions History - this area shows the history of all transactions in a dedicated grid. 

 

The grid contains the following columns:

  • Date - Displays the date when the transaction occurred;

  • Action - Describes the essentials of the transaction;

  • Amount - Displays balance increments or decrements in green and red accordingly;

  • Comment for Admin - Comments to the transactions available to admins;

  • Reward Balance - The balance available after the transaction.

The same as any Magento grid, this one makes it possible to sort and filter data and customize the view.

The greatest benefit and value brought by this section is that it allows you to manually update particular reward balances. You can use this opportunity in case of order refunds or in order to additionally award particular brand advocates for their prominent achievements. Each such transaction can be accompanied by comments visible to admins only.

Advocate Information Page | Refer a Frined for Magento 2 

Other Features

In addition to the functionality described above, the extension also provides some more benefits for store owners and development teams.

  • GDPR Compliance (Right to erasure)

In order to follow the GDPR requirements, the module erases all refer-a-friend activities in case if a customer profile is deleted.

  • Web API and Unit Tests

The code of the extension is covered by unit tests and includes REST API, so you can test its compatibility and integrate it with other solutions much easier.

 

Refer a Friend Storefront Interface

Once a rule is configured, eligible customers see a Referral Program tab in their account.

  • Program Terms: Displays detailed explanations of rewards for the advocate and discounts for the friend.

  • Invitation Block: Allows advocates to generate a unique referral link and use ShareThis or AddThis for social sharing.

  • Performance Dashboard: Shows the number of invited friends, current reward balance, and a checkbox for reward notifications.

    Note: If a customer is excluded from the referral group, they can still spend earned rewards, but their ability to invite new friends is revoked

 Frontend Interface | Refer a Frined for Magento 2

 

Refer a Friend | Refer a Frined for Magento 2

Product Page

Write Your Own Review

Already used our product?

We would appreciate your feedback. Please, leave a review.

Only registered users can write reviews. Please Sign in or create an account
Report incorrect information

Still Have Questions?

Our customer care team is here for you!

Contact Us