{"id":8965,"date":"2020-03-03T17:35:23","date_gmt":"2020-03-03T12:05:23","guid":{"rendered":"https:\/\/www.botreetechnologies.com\/blog\/?p=8965"},"modified":"2021-01-08T11:32:27","modified_gmt":"2021-01-08T06:02:27","slug":"how-to-add-affiliation-features-to-spree-commerce","status":"publish","type":"post","link":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/","title":{"rendered":"How to add Affiliation features to Spree Commerce"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What is Spree Affiliate?<\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/vinsol-spree-contrib\/spree_reffiliate\">Spree Reffiliate<\/a> is a spree extension that provides the functionality of user referrals and affiliate features to your spree store.<\/p>\n\n\n\n<p>A unique link is generated for users which is shareable to friends and once users purchase a product via that path, then affiliate gain benefits.<\/p>\n\n\n\n<p>Affiliate users are users who earn commission while placing an order or user registrations on their affiliate links sharing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Features:<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>A specific role for an affiliate user who gets a commission as per the commission rules created.<\/li><li>Affiliates get the information about the commissions received in the account panel.<\/li><li>Referral codes are generated for users, used to refer to other users.<\/li><li>Users can see the number of referred users and their details in their account panel.<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Installation:<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Add \u201c<span style=\"color: #0000ff;\">spree_reffiliate<\/span>\u201d to your <span style=\"color: #0000ff;\">Gemfile<\/span>.<br><code>gem 'spree_reffiliate', github: 'vinsol-spree-contrib\/spree_reffiliate'<\/code><\/li><li>Install the dependencies using:<br><code>bundle install<\/code><\/li><li>Run the installation generator:<br><code>bundle exec rails g spree_reffiliate:install<\/code><\/li><li>If you already have users in your database, then generate the referral codes for the existing users using the following code:<br><code>bundle exec rake reffiliate:generate<\/code><\/li><li style=\"text-align: left;\">Open rails console and create commission rules for User Registration and Order placement as shown below:<br><code>Spree::CommissionRule.find_or_create_by(name:Spree::CommissionRule::USER_R<br>\nEGISTRATION, fixed_commission: true)<\/code><br><code>Spree::CommissionRule.find_or_create_by(name:Spree::CommissionRule::ORDER_<br>\nPLACEMENT, fixed_commission: false)<\/code><\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Changes in View:<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Login as admin<\/li><li>Following links will be available in the side menu:<\/li><\/ol>\n\n\n\n<p>           a. <code>Configurations &gt; Affiliates<\/code><br>           b. <code>Configurations &gt; Referrals<\/code><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Configurations.png\" alt=\"Configurations\" class=\"wp-image-12675\" width=\"245\" height=\"512\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Configurations.png 245w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Configurations-144x300.png 144w\" sizes=\"auto, (max-width: 245px) 100vw, 245px\" \/><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-left\">&nbsp;3. If you visit <code>Configurations &gt; Affiliates<\/code>, you will see,<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"159\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/configurations-affiliates.png\" alt=\"configurations affiliates\" class=\"wp-image-12676\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/configurations-affiliates.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/configurations-affiliates-300x47.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/configurations-affiliates-768x119.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>&nbsp;4. If you visit <code>Configurations &gt; Referrals<\/code>, you will see,<br>Here, in the below image, these configurations are global settings to award the user credits as store credits on referrals and provide benefits.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/referrals-settings.png\" alt=\"Referral settings\" class=\"wp-image-12677\" width=\"446\" height=\"227\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/referrals-settings.png 595w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/referrals-settings-300x152.png 300w\" sizes=\"auto, (max-width: 446px) 100vw, 446px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Implementation: Basically, there are 2 flows:<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Affiliation<\/strong>: It works as a third party and gets a commission on user registration and order placement.<\/li><li><strong>Referrals<\/strong>: Users get store credits in their account by sharing the unique codes generated to their friends and get benefits.<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Affiliation Flow:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Admin end ( Backend )<\/strong><\/li><\/ul>\n\n\n\n<ol class=\"wp-block-list\"><li>Login as admin<\/li><li>Create an affiliate user by visiting the link <code>Configurations &gt; Affiliates &gt; Add New Affiliate:<\/code><\/li><\/ol>\n\n\n\n<ul class=\"wp-block-list\"><li> <strong>Path<\/strong>: A custom path for affiliate users which is shareable to any user to earn benefits as per the commission rules defined. <\/li><li> <strong>Commission Rules:<\/strong> <ol><li>Here, we created the commission rules above for User Registration and Order Placement.<\/li><li>The affiliate user will get benefits on every user registration and order placement by using the affiliate link as per the rules defined.<\/li><li>The user registration rule should have some amount.<\/li><li>The order placement rule should have value in percentage (%). <\/li><\/ol><\/li><\/ul>\n\n\n\n<p><strong>Note:<\/strong> &nbsp;The rules defined are applied to every affiliate user and can be customized as per the affiliate\u2019s requirement.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"496\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/listing-affiliates.png\" alt=\"listing affiliates\" class=\"wp-image-12678\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/listing-affiliates.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/listing-affiliates-300x145.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/listing-affiliates-768x372.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"545\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/new-affiliates.png\" alt=\"new affiliates\" class=\"wp-image-12679\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/new-affiliates.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/new-affiliates-300x160.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/new-affiliates-768x409.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>After successful creation, the affiliate user will be notified using an email with the activation link to activate the affiliate account.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"655\" height=\"311\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/activation-link-instruction.png\" alt=\" activation link instruction\" class=\"wp-image-12680\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/activation-link-instruction.png 655w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/activation-link-instruction-300x142.png 300w\" sizes=\"auto, (max-width: 655px) 100vw, 655px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Affiliate side<\/strong><\/li><\/ul>\n\n\n\n<p>Hit the link provided in the email, and you will be redirected to the edit password page for affiliate users.  <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"592\" height=\"390\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/editing-affiliate.png\" alt=\" affiliate users creation\" class=\"wp-image-12681\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/editing-affiliate.png 592w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/editing-affiliate-300x198.png 300w\" sizes=\"auto, (max-width: 592px) 100vw, 592px\" \/><\/figure><\/div>\n\n\n\n<p>Fill in the form with the password and confirmation password, and you will be logged in as an affiliate user in the application.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"719\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/affiliate-password-and-confirmation-password.png\" alt=\"affiliate user details creation\" class=\"wp-image-12682\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/affiliate-password-and-confirmation-password.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/affiliate-password-and-confirmation-password-300x211.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/affiliate-password-and-confirmation-password-768x539.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>The affiliate link is shared with other users to gain benefits.<\/p>\n\n\n\n<p>If there is a partial while creating an affiliate, then it will redirect to the home page embedded with the specified partial. Otherwise, it will be redirected to the home page. <\/p>\n\n\n\n<p>Partial should be available at <code>app\/views\/spree\/affiliates<\/code> path for customizations. <\/p>\n\n\n\n<p>Affiliate users share their affiliate link available in the <code>MyAccount<\/code> via any media source.<\/p>\n\n\n\n<p>Other users can visit the affiliate\u2019s link, and can purchase products or goods as per their requirements.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>User side<\/strong><\/li><\/ul>\n\n\n\n<p>Hit the affiliate link received.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"922\" height=\"317\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/hit-the-link.png\" alt=\"Hit the affiliate link received\" class=\"wp-image-12683\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/hit-the-link.png 922w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/hit-the-link-300x103.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/hit-the-link-768x264.png 768w\" sizes=\"auto, (max-width: 922px) 100vw, 922px\" \/><\/figure><\/div>\n\n\n\n<p>Register the user to the application.  <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"562\" height=\"400\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/register-the-newuser.png\" alt=\"Register the user to the application\" class=\"wp-image-12684\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/register-the-newuser.png 562w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/register-the-newuser-300x214.png 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/figure><\/div>\n\n\n\n<p>Affiliate User for the newly registered user will get a commission on user registration as defined for that respective affiliate. <\/p>\n\n\n\n<p>To check out the commission received, go to MyAccount panel of the affiliate user. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"512\" height=\"331\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/MyAccount-panel.png\" alt=\"MyAccount panel\" class=\"wp-image-12685\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/MyAccount-panel.png 512w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/MyAccount-panel-300x194.png 300w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/figure><\/div>\n\n\n\n<p>After successful registration, if the newly registered user places an order with the standard checkout process, the respective affiliate user will earn commission as per the commission rule defined for order placement. <\/p>\n\n\n\n<p>Commission Transactions can be viewed in <span style=\"color: #0000ff;\">MyAccount<\/span> section for the order placed. <\/p>\n\n\n\n<p><strong>Note:<\/strong> If the user places an order without hitting the affiliate link then the affiliate user will not get the respective commissions.<\/p>\n\n\n\n<p>But after hitting the affiliate link, successful user registration, placing an order with a standard checkout process will provide the commission amount for User Registration and Order Placement to the respective affiliate user.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"770\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/Order-Placement.png\" alt=\"Registration and Order Placement\" class=\"wp-image-12697\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/Order-Placement.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/Order-Placement-300x226.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/Order-Placement-768x578.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>Admin can view the affiliates list, their transactions, and commissions received for what type, i.e. User registration\/Order Placement.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How will the Commission be Paid to Affiliate Users?<\/h2>\n\n\n\n<p>The commission paid to the affiliate will be paid by admin when the commission cycle will complete.<\/p>\n\n\n\n<p><strong>Commission Cycle:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Commission Created for affiliate user has a start date and end date.<\/li><li>Example:\n<ul>\n<li>Let\u2019s suppose a new user is registered using the affiliate\u2019s link on Dec 19, 2019 ( 19-12-2019 )<\/li>\n<li>Commission for that respective affiliate user will be created for user registration.<\/li>\n<li><strong>Start date<\/strong> for the commission will be the current month\u2019s start date for when the commission is created.<\/li>\n<li>For e.g.: Commission for user registration will be created on 19-12-2019, hence start date = 1-12-2019.<\/li>\n<li><strong>End date<\/strong> for the commission will be the current month\u2019s end date for when the commission is created.<\/li>\n<li>End date = 31-12-2019.<\/li>\n<\/ul>\n<\/li><li style=\"text-align: left;\">The commission cycle completes at the end of the current month.<\/li><li>Hence, after the current month&#8217;s completion, admin is able to pay the commissions to the affiliate users.<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Referrals Flow:<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Admin can gain benefits by sharing the referral codes to his friends, family, colleagues, etc.<\/li><li>Any user can share their referral codes with other end users.<\/li><li>Users visiting the referral links get the benefit in the form of store credits configured globally in the admin panel as well as it can be user-specific.<\/li><li>Some configurations are required to be done from the admin panel to avail referrals credits.<\/li><\/ul>\n\n\n\n<p><strong>Global Settings:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Login as admin<\/li><li>Visit the referrals section from <code>Configurations &gt; Referrals<\/code>:\n<ol>\n<li><code>Store Credits to be awarded<\/code> are the credits the user would be getting on any referral.<\/li>\n<\/ol>\n<ol>\n<li>Fill this input with the value with the credits you want to award with.<\/li>\n<li>Check the flag <code>Give Referral Benefits<\/code> to avail referral credits.<\/li>\n<\/ol>\n<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"137\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2021\/01\/referral.png\" alt=\" referral credits\" class=\"wp-image-14859\"\/><\/figure><\/div>\n\n\n\n<p><strong>Note:<\/strong> If you don\u2019t want the referral credits to be awarded just uncheck the flag <code>Give Referral Benefits<\/code> in <code>Configurations &gt; Referrals<\/code><\/p>\n\n\n\n<p>If you want to user-specific store credits to be received, then you can always edit as shown below by visiting the <strong>Users edit<\/strong> link.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"455\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Users-edit-link.png\" alt=\"Users edit link\" class=\"wp-image-12688\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Users-edit-link.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Users-edit-link-300x133.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Users-edit-link-768x341.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>On this user\u2019s successful referrals, referrer (<a href=\"mailto:admin@gmail.com\">admin@gmail.com<\/a>) will receive <strong>$10<\/strong> as store credit as it is configured to be user-specific.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How do Referrals Work?<\/h2>\n\n\n\n<p>Login as admin.<\/p>\n\n\n\n<p>Visit the account panel.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"491\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/account-panel.png\" alt=\"MyAccount panel of the affiliate user\" class=\"wp-image-12689\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/account-panel.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/account-panel-300x144.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/account-panel-768x368.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>Admin can share the referral link via any media source to other users.<\/p>\n\n\n\n<p>Users with the referral link of the referred user hit the link in the browser gets benefits on sign up. <\/p>\n\n\n\n<p>Hit the referral link in the browser.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"512\" height=\"179\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Hit-the-referral-link.png\" alt=\"Hit the referral link in the browser\" class=\"wp-image-12690\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Hit-the-referral-link.png 512w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Hit-the-referral-link-300x105.png 300w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/figure><\/div>\n\n\n\n<p>Sign up for a new user.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"571\" height=\"400\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Signup-for-newuser.png\" alt=\"Sign up for a new user\" class=\"wp-image-12691\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Signup-for-newuser.png 571w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Signup-for-newuser-300x210.png 300w\" sizes=\"auto, (max-width: 571px) 100vw, 571px\" \/><\/figure><\/div>\n\n\n\n<p>Admin receives the referral award that can be viewed in the account panel.<\/p>\n\n\n\n<p>Admin can view his referrals details in his account panel.<br><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"646\" height=\"139\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Admin-receives-the-referral-award.png\" alt=\"Admin receives the referral award that can be viewed \" class=\"wp-image-12692\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Admin-receives-the-referral-award.png 646w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/Admin-receives-the-referral-award-300x65.png 300w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"399\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/admin-account-panel.png\" alt=\"admin account panel\" class=\"wp-image-12693\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/admin-account-panel.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/admin-account-panel-300x117.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/admin-account-panel-768x299.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p> When you click on <strong>View Details<\/strong>, you will be able to see the number of referred users and credits received on referrals.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"131\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/View-Details.png\" alt=\"referred users View Details\" class=\"wp-image-12694\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/View-Details.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/View-Details-300x38.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/View-Details-768x98.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>Admin can view the referral store credits in the Users section, as shown below:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"512\" height=\"166\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/referral-store-credits.png\" alt=\"referral store credits\" class=\"wp-image-12695\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/referral-store-credits.png 512w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/11\/referral-store-credits-300x97.png 300w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/figure><\/div>\n\n\n\n<p><strong>Note:<\/strong>&nbsp; Here, the admin receives the store credits configured in the global settings section above rather than the newly registered user.<\/p>\n\n\n\n<p>But, customizations can be done as per the requirement.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A registered user can also share his referral code with his friends, family, colleagues to earn benefits.\n<ul>\n<li>Registered users can also follow the same procedure as admin referred to other users by following steps 2 to 4 in the above section.<\/li>\n<\/ul>\n<\/li><\/ul>\n\n\n\n<p>There is <strong>no constraint<\/strong> in the number of users to be referred that can up to <strong>infinity<\/strong> too!!<\/p>\n\n\n\n<p><strong>Amazing facts:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li> Referral links will be in the form of <code>\/r\/:referral_code<\/code><\/li><li>Affiliate links will be in the form of <code>\/a\/:path<\/code> <\/li><\/ul>\n\n\n\n<p>BoTree Technologies is a leading <a href=\"https:\/\/www.botreetechnologies.com\/spree-commerce-development\" target=\"_blank\" rel=\"noopener noreferrer\">spree commerce development company<\/a> in Ahmedabad that builds top-notch software and ecommerce solutions to increase business revenue and maximize productivity. <a href=\"https:\/\/www.botreetechnologies.com\/contact\" target=\"_blank\" rel=\"noopener noreferrer\">Get a FREE CONSULTATION<\/a> from our CEO.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is Spree Affiliate? Spree Reffiliate is a spree extension&#8230;<\/p>\n","protected":false},"author":56,"featured_media":12674,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[75,10],"tags":[],"class_list":["post-8965","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spree-commerce","category-technology"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to add Affiliation features to Spree Commerce<\/title>\n<meta name=\"description\" content=\"Want to know how to add affiliation feature to a Spree Commerce website? Here\u2019s a quick guide with the steps and code to simplify the process.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to add Affiliation features to Spree Commerce\" \/>\n<meta property=\"og:description\" content=\"Want to know how to add affiliation feature to a Spree Commerce website? Here\u2019s a quick guide with the steps and code to simplify the process.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/\" \/>\n<meta property=\"og:site_name\" content=\"BoTree Technologies\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/BoTreeTechnologies\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-03T12:05:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-08T06:02:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/reaffiliation-features-to-spree-commerce.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1280\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Hunny Jummani\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@BoTreeTech\" \/>\n<meta name=\"twitter:site\" content=\"@BoTreeTech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hunny Jummani\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/\"},\"author\":{\"name\":\"Hunny Jummani\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/0d616df8a58c8145fae7ceb8d048e23e\"},\"headline\":\"How to add Affiliation features to Spree Commerce\",\"datePublished\":\"2020-03-03T12:05:23+00:00\",\"dateModified\":\"2021-01-08T06:02:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/\"},\"wordCount\":1296,\"commentCount\":11,\"image\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/reaffiliation-features-to-spree-commerce.jpg\",\"articleSection\":[\"Spree Commerce\",\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/\",\"name\":\"How to add Affiliation features to Spree Commerce\",\"isPartOf\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/reaffiliation-features-to-spree-commerce.jpg\",\"datePublished\":\"2020-03-03T12:05:23+00:00\",\"dateModified\":\"2021-01-08T06:02:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/0d616df8a58c8145fae7ceb8d048e23e\"},\"description\":\"Want to know how to add affiliation feature to a Spree Commerce website? Here\u2019s a quick guide with the steps and code to simplify the process.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#primaryimage\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/reaffiliation-features-to-spree-commerce.jpg\",\"contentUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/reaffiliation-features-to-spree-commerce.jpg\",\"width\":1920,\"height\":1280,\"caption\":\"adding Affiliation features\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.botreetechnologies.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to add Affiliation features to Spree Commerce\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#website\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/\",\"name\":\"BoTree Technologies\",\"description\":\"Committed to inspire generation.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.botreetechnologies.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/0d616df8a58c8145fae7ceb8d048e23e\",\"name\":\"Hunny Jummani\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/hunny-jummani-150x150.png\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/hunny-jummani-150x150.png\",\"contentUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/hunny-jummani-150x150.png\",\"caption\":\"Hunny Jummani\"},\"description\":\"I am a Ruby On Rails Developer. I love JavaScript, logical problem solving in Ruby and exploration of new things. Apart from coding, I also like to travel, listen music and play guitar.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to add Affiliation features to Spree Commerce","description":"Want to know how to add affiliation feature to a Spree Commerce website? Here\u2019s a quick guide with the steps and code to simplify the process.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/","og_locale":"en_US","og_type":"article","og_title":"How to add Affiliation features to Spree Commerce","og_description":"Want to know how to add affiliation feature to a Spree Commerce website? Here\u2019s a quick guide with the steps and code to simplify the process.","og_url":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/","og_site_name":"BoTree Technologies","article_publisher":"https:\/\/www.facebook.com\/BoTreeTechnologies\/","article_published_time":"2020-03-03T12:05:23+00:00","article_modified_time":"2021-01-08T06:02:27+00:00","og_image":[{"width":1920,"height":1280,"url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/reaffiliation-features-to-spree-commerce.jpg","type":"image\/jpeg"}],"author":"Hunny Jummani","twitter_card":"summary_large_image","twitter_creator":"@BoTreeTech","twitter_site":"@BoTreeTech","twitter_misc":{"Written by":"Hunny Jummani","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#article","isPartOf":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/"},"author":{"name":"Hunny Jummani","@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/0d616df8a58c8145fae7ceb8d048e23e"},"headline":"How to add Affiliation features to Spree Commerce","datePublished":"2020-03-03T12:05:23+00:00","dateModified":"2021-01-08T06:02:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/"},"wordCount":1296,"commentCount":11,"image":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#primaryimage"},"thumbnailUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/reaffiliation-features-to-spree-commerce.jpg","articleSection":["Spree Commerce","Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/","url":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/","name":"How to add Affiliation features to Spree Commerce","isPartOf":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#primaryimage"},"image":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#primaryimage"},"thumbnailUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/reaffiliation-features-to-spree-commerce.jpg","datePublished":"2020-03-03T12:05:23+00:00","dateModified":"2021-01-08T06:02:27+00:00","author":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/0d616df8a58c8145fae7ceb8d048e23e"},"description":"Want to know how to add affiliation feature to a Spree Commerce website? Here\u2019s a quick guide with the steps and code to simplify the process.","breadcrumb":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#primaryimage","url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/reaffiliation-features-to-spree-commerce.jpg","contentUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/03\/reaffiliation-features-to-spree-commerce.jpg","width":1920,"height":1280,"caption":"adding Affiliation features"},{"@type":"BreadcrumbList","@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-add-affiliation-features-to-spree-commerce\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.botreetechnologies.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to add Affiliation features to Spree Commerce"}]},{"@type":"WebSite","@id":"https:\/\/www.botreetechnologies.com\/blog\/#website","url":"https:\/\/www.botreetechnologies.com\/blog\/","name":"BoTree Technologies","description":"Committed to inspire generation.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.botreetechnologies.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/0d616df8a58c8145fae7ceb8d048e23e","name":"Hunny Jummani","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/hunny-jummani-150x150.png","url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/hunny-jummani-150x150.png","contentUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/hunny-jummani-150x150.png","caption":"Hunny Jummani"},"description":"I am a Ruby On Rails Developer. I love JavaScript, logical problem solving in Ruby and exploration of new things. Apart from coding, I also like to travel, listen music and play guitar."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/8965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/users\/56"}],"replies":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=8965"}],"version-history":[{"count":5,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/8965\/revisions"}],"predecessor-version":[{"id":14860,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/8965\/revisions\/14860"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/media\/12674"}],"wp:attachment":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=8965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=8965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=8965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}