Use eC to buy a role?

Events happening in the community are now at Drupal community events on www.drupal.org.
mrtoner's picture

When I decided I wanted to create a membership site, I realized that Drupal and and the e-Commerce module could probably do what I needed. The membership site will be selling content on a monthly basis. Users that subscribe during a given month will have access to that month's content.

I figured the easiest way to do this would be to use some sort of access control to assign a role -- for example, "200712" -- to a particular node. Then any subscriber with the appropriate role could access that content.

Can I use eC to assign a role to a user whenever a (recurring) payment comes in? (If it matters, I'll be using PayPal.) I don't want to change the user's role, just give them an additional role. I guess the question is, can I use eC to buy a role, rather than buy a node?

Best regards,
Don Morris

Comments

Hi mrtoner,

slayerment's picture

Hi Don,

I am actually setting up this same type of set up for one of my sites right now.

From my understanding the eC role allows you to assign a role after somebody buys a node. So I created a node called "Membership" that sells for $15.

I then wrote a quick little side module that automatically adds this node to their cart when they register and then takes them to the checkout page. Once they purchase this node they are assigned the new "Member" role (different than authenticated user) via eC roles.

I also am using eC recurring to disable this roll after 3 months. In order for them to maintain being a part of this roll they would need to re-buy my Membership node once again.

That is my current flow for this and it seems to be a pretty smooth way to do it.

Lemme know what you think.

Quinton

Sounds pretty similar,

mrtoner's picture

Sounds pretty similar, although I'd simply want setup a recurring payment (at PayPal) and only expire the membership if the customer canceled the subscription.

Each month as the subscription payment came in, I'd want a new (additional) role assigned to the user. The content that I add that month will be accessible by users with that role.

Don

Ah, I see. As far as adding

slayerment's picture

Ah, I see.

As far as adding a new roll as each new payment comes in that would probably require some type of new module or extension to the ec_recurring module as I don't think this type of thing exists right now.

Hopefully somebody with more knowledge of eC can shed some light on this.

MrToner, I think you're

niklp's picture

MrToner, I think you're looking at this from the wrong angle - you don't need a new role for each month. What you could do instead is have a members role, and set up some sort of system that would revoke that role if a recurring payment is not met. That's basically the same thing "the other way around". This negates the need for all those roles, which seems like a weird idea to me...

Kineta Systems - Web Development in Nottingham, UK

I may have the wrong angle,

mrtoner's picture

I may have the wrong angle, but my purpose in doing it this way is so that all members cannot have access to all content.

If I simply had a Members role, then I could not restrict specific content to members that had paid for a specific month. As I add content, I'll restrict content to a specific role -- e.g., "200801" -- using an access control module. If a member starts his subscription in March, he can only access content from January and February if he pays an additional fee for that.

Do you see another way to accomplish this?

Don

I had actually considered

niklp's picture

I had actually considered that option, but I just dismissed it as I thought it was too niche. In general one would assume that "old" content becomes free. That's obviously not the case, so...

Perhaps you could have a taxonomy with a term for each month. You could create these terms automatically using cron and a small module. You can then categorise each month's content under the correct month term, as well as any other categories, as necessary. Then you would need to implement a permissions system that works by term.

Check these modules out (there's probably other similar ones) - something along these lines will probably achieve what you want.
http://drupal.org/project/taxonomy_access
http://drupal.org/project/tac_lite

You'll of course need to tie deny/allow access to these terms to the e-commerce system and recurring payments. That's all I can think of right now...! :)

Kineta Systems - Web Development in Nottingham, UK

Further to my previous

niklp's picture

Further to my previous comments, I just discovered this module, which I think will help illustrate/implement what I was saying:
http://drupal.org/project/taxorole
Kineta Systems - Web Development in Nottingham, UK

Access control isn't the

mrtoner's picture

Access control isn't the problem -- it's dynamically granting the access each month as the subscription payment from PayPal comes in.

I'm familiar with access control; I use nodeacess in another project and plan on using it here. Taxorole and other taxonomy-based access controls add another layer of control that I don't believe I need.

Assuming I add a node to my site in January 2008 and grant access to the node (through nodeaccess) to the role 200801 or assign the node the term 200801 which (through Taxorole) grants access to the same role, I need a way to assign the 200801 role to all members who pay via subscription in January 2008.

e-Commerce Module

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week