I've just finished setting up my drupal-powered drupal themes affiliate program and I figured I should share how I did it, since I think my set-up is better than what's done in the original documentation, for some people. This set-up guide also highlights some problems in the module.

1. Download modules

As the affiliate modules' scope is limited to the actual affiliate center, we need some extra modules for signing up new members and having existing users apply for the program:

You have to download and enable the above modules.

2. Create the affiliate info/sign-up page

You need to create a webpage to advertise the affiliate program and point people to the sign-up pages. As an example, take a look at my Premium Drupal theme affiliate program called SooperFriends. For now just create a simple page stating the terms of your program and the payouts your affiliates will receive. Creating the sign-up buttons is covered in the next steps.

3. Adding affiliate related fields to the user profile

You need to collect payment information from your affiliates, and if you want to screen them before approving their application you should also ask them for the website they will use to promote your website. You can add these fields at /admin/user/profile:

3. Setting up the affiliate role

  1. Create a role named affiliate over at /admin/user/roles
  2. Give this role the permission to act as an affiliate over at /admin/user/permissions
  3. While you're still in the permissions screen, give authenticated users the permission to apply for roles
  4. Go to /admin/settings/apply_for_role and enable to optionally apply for role on registration and check the affiliate role:

4. The sign-up buttons

Basically the buttons are just links, but since these buttons are the primary call-to-action on your page it would be good if they stand out, so shiny buttons would be cool but text links will also work. If you did the previous steps correctly, new users can now sign up to be an affiliate the the registration page at /user/register:

Existing members of your website have to sign-up via some link that is hidden in their user profile administration. This is where th me module helps out, we can deeplink into the users'profile management and link straight to the page they need to see: http://example.com/user/me/apply_for_role

So finally the HTML for the buttons looks something like this:

{syntaxhighlighter brush: xml}

If you apply for the program, please fill in your website and paypal address at regstration or in your account settings.


5. Setting up notifications

Since you will want to review affiliate applications quickly, you have to set up a notification email that is triggered when someone requests affiliate status. Go to /admin/settings/actions and add a send e-mail action like this one:

Now you have to trigger this action over at /admin/build/trigger/apply_for_role. Select the action you have just created for the trigger: When a user submits an application for a role. This will send an email to the admin about the new affiliate application.

Finally we need to create a notification of the approval of an affiliate account. This notification is set up at the role change notify module page over at /admin/user/role_change_notify. Check the checkbox for the affiliate role. This is the email I send to my affiliates:


The role "[role_changed]" has been added to your account at  [site-name].

You may now access the affiliate center at sooperthemes.com.

Best Regards,
Jurriaan Roelofs

As you can see this email also makes use of the nifty me module


Your affiliate program is now fully operational, however when you are logged in as admin and try to check the affiliate center you will find it to be missing. This is because the module explicitly hides the affiliate pages from user 1. I created an issue about this here: http://drupal.org/node/985214. The inability of the admin to view the affiliate center also means you can't create menu links to these pages, fortunately it was easy to fix this bug, you can read about this in the issue.

Got custom content types for products? you're not done yet...

The affiliate center in this module has a feature that generates product links. Unfortunately this feature has hardcoded the ubercart product content type in the SQL query that seeks out your list of products. Seems like there is a patch for this over here: http://drupal.org/node/801304. Looks like it was committed so upgrading to the dev version will probably fix this for you.


Dec 1, 2010 By Jurriaan