Skip to content

Spree Reffiliate is a Spree Extension that adds the referral and affiliate features to your Spree Store. Users are going to be able to share a unique hyperlink with their friends to gain benefits and you'll be able to create affiliate campaigns through the Spree Administrator and configure it to your needs.

License

Notifications You must be signed in to change notification settings

spree-edge/spree_reffiliate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spree Reffiliate

Codeship Status for kinduff/spree_reffiliate Build Status Code Climate Test Coverage

Spree Reffiliate is a Spree Extension that adds the referral and affiliate features to your Spree Store. Users are going to be able to share a unique hyperlink with their friends to gain benefits and you'll be able to create affiliate campaigns through the Spree Administrator and configure it to your needs.

Demo

Try Spree Reffiliate for Spree Master with direct deployment on Heroku:

Deploy

Try Spree Reffiliate for Spree 3-4 with direct deployment on Heroku:

Deploy

Try Spree Reffiliate for Spree 3-1 with direct deployment on Heroku:

Deploy

Referrals

  • Each user will have a unique link associated to his account which he can use to refer other users.
  • User can signup as a referred user
  • Referred user can have promotions
  • Referrer can have store credits.

Affiliates

  • Admin is able to create an affiliate with a custom path.
  • Customize the affiliate view with a partial
  • Affiliate can get commission in two ways: (i) Order placement (ii) User Registration
  • These commission amount can be defined from affiliate_commission_rules on affiliate new/edit page.
  • After successful user-creation/order-placement, a transaction will be created which will have the amount and commissionable(user/order).
  • Affilate can view it in account panel.
  • Affiliated user can have individual promotions
  • Admin is able to see affiliated users and orders from affiliate

Spree Reffiliate

Installation

To use the stable branch, add this line to your Gemfile:

gem 'spree_reffiliate', github: 'vinsol-spree-contrib/spree_reffiliate'

Bundle your dependencies and run the installation generator:

bundle
bundle exec rails g spree_reffiliate:install

Seed the Commission Rules from seed.rb

Existing Users

If you already have users within your database, you'll need to run the following command to generate the referral registry for your users:

bundle exec rake reffiliate:generate

Usage

Referral path is /r/:code and Affiliate path (assigned in the admin) is /a/:path

Once installed, you'll be able to access the following methods.

Spree::User

  • referred_by => user record
  • referral_count => user count
  • referred? => boolean
  • affiliate? => boolean
  • affiliate => affiliate record
  • referral => referral record
  • associated_partner => user corrosponding to affiliate.

Spree::Referral

  • code => referral code
  • referred_users => array of users
  • referred_orders => array of orders
  • referred_count => user count
  • referral_activated_users => users with completed orders

Spree::Affiliate

  • referred_users => array of users
  • referred_orders => array of orders
  • referred_count => user count

Affiliates

  • Affiliate listing can be found in affiliates subtab. Affiliate Registration

  • Admin can create a new affiliate. Affiliate Registration

  • Affiliate will be send a email which will have an activation link. Affiliate Confirmation

Affiliate Account Details

Commissions

  • Admin can manage commission for an affiliate by default. Commission Listing

  • Admin can pay commission, once the commission cycle completes. The commission tab will have pay button which will mark respective commission as completes. This action, as a result, also locks corrosponding transactions. Commission Search

  • Commission search has advanced search filters. Commission Search

Transactions

  • Admin can list the transactions of affiliates. Transactions Listing

User account

  • User can see its affiliate link from my account. User account

  • Moreover, the user can check the transactions from account details page. User account

Referrals

  • Each user will have a unique link associated to his account which he can use to refer other users. Affiliate Account Details

  • User can signup as a referred user

  • Referred user can have promotions

  • Admin is able to see referred users and orders from user

  • Referrer gets store credit for successful referrals. A referral will be considered successful if referred user successfully signs up.

  • Admin can configure referral settings. There are two settings for giving referral benefits to referrer. One is the global setting found under configuration tab and other is user specific setting. Global Referral Setting

  • Global Settings : There are two global settings under Configuration->Referrals tabs with regard to referral. One is the store credit amount that would be credited to referer's account on each successful referral. Other is a checkbox to enable and disable the referral benefit to a referrer. By default store credit amount is set to 0 and referral benefit is disabled. Referral Settings Edit

  • User Specific Settings : Admin can override the referral settings for a particular user in user's general settings, where he may disable/enable the referral benefits and change the store credit amount. Default value for store credit is nil and referral benefit is enabled. User Specific Settings

  • Referrer will receive store credit when referral is enabled at both global and user level. Store credit amount in user setting will have precedence over the global setting. In case the value is nil in user setting then global setting would apply for store credit amount. +Referrer will receive mail on store credit transfer to his account Store Credit Mail

  • Each user can see their referrals under My Account section. To see the details of referrals user can click on view more where all referred users will be listed with store credit amount and date of sign up by referred user. User Referral Details

  • Admin can see store credits for a particular user under user's store credit section. The store credits received for referral will be listed under Referral Credit category. User Store Credits

Testing

First bundle your dependencies, then run rake. rake will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app.

bundle
bundle exec rake

See It In Action

Youtube Video Tutorial

Credits

Copyright (c) 2014 Alejandro AR, released under the New BSD License

About

Spree Reffiliate is a Spree Extension that adds the referral and affiliate features to your Spree Store. Users are going to be able to share a unique hyperlink with their friends to gain benefits and you'll be able to create affiliate campaigns through the Spree Administrator and configure it to your needs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 68.3%
  • HTML 31.2%
  • JavaScript 0.5%