9 replies [Last post]
asciikewl@drupal.org's picture
Offline
Joined: 05/09/2008
Juice: 5
Was this information Helpful?

I'd like to set up a site where the user has to pay to view a node.

Finding what he/she would like must happen with a view (table of some of the CCK fields) and to see the rest of the CCK fields (full node view) the user must pay for the privilege.

Is there anything like that available?

What would be the complexity of coding something like that?

Thanx

Anton

thomas's picture
Offline
Joined: 05/07/2008
Juice: 5
purchasing role

Hello Anton,

I think you could solve this role based.

Upon purchase the user has a role assigned, that enables him to access the content.

There is an example in ubercart itself.

Purchase the 'membership' or sth like that.

hth - regards,
thomas.

drupalcornwall's picture
Offline
Joined: 05/08/2008
Juice: 43
trying to do similar, failing

hi, if anyone can propose a rough recipe for doing this i'd be grateful.
i just can't seem to get my head around this one! have tried using role assignment but its granting access to all nodes, not just the one purchased. i.e. cannot get it to assign the role on a single, per-node basis.

any ideas anyone? this seems like it should be so simple but i've been banging my head against this one for days now!

i have been using the old cck field permissions module for D5 which I know may be buggy, but i don't see any other option at the moment.

also is there a way to set ubercart to regard every product as a single, one off product? without using the Stock levels / Inventory Contributed Module?

thanks for any help at all on this.

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: trying to do similar, failing

I think it could involve another module, such as Content Access (along with the ACL API):

http://drupal.org/project/acl
http://drupal.org/project/content_access

You would then have to write a custom module that hooks into hook_order() - since you are not purchasing a role, but a node - the module would have to allow access by hooking into the ACL and granting access to that node for that user.

Sounds simple in abstract but I haven't done any digging to give you a real concept of the work it would entail. I'm sure it's possible, it just hasn't been done yet AFAIK Smiling

--
Help directly fund development: Donate via PayPal!

drupalcornwall's picture
Offline
Joined: 05/08/2008
Juice: 43
Re: Re: trying to do similar, failing

Thanks for your help with this - it does clarify what I suspected - the need to write my own module. I have no PHP experience, am really more a designer so this is pretty much what I was trying to avoid, but maybe i'll have to get my hands dirty with code!

Does anyone know if Shopify might fit the bill out of the box for my needs? I like Ubercart a lot but need something up in a hurry for a client, and am pushed for time. Not ideal I know!

Thanks for any advice!

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: trying to do similar, failing

IIRC there was some work being done on purchasable nodes (as a Contrib module for Ubercart) but I'm not sure what progress has been made, if any. Actually they were more along the lines of "Publishing" nodes but have a look.

http://www.ubercart.org/forum/development/2121/uc_nodetype_module_purcha...

http://www.ubercart.org/forum/support/1987/purchase_right_publish_node

--
Help directly fund development: Donate via PayPal!

asciikewl@drupal.org's picture
Offline
Joined: 05/09/2008
Juice: 5
Linking nodes to products?

I've had a look at allowing access to nodes and I have a good idea how to implement the access part IF I can get an idea how to populate a "paid for" table with (uid,nid,expiry_date).

A few questions:

1) Would I have to create a product for each node or is there a way I can get away with only 1 product. What I have in mind is adding a link to the view (eg. Add this CV to your cart). What would the appropriate function be to call with this link? Could I store some extra data (the nid) with this function to use when the payment is made?

2) I assume I can implement a hook that will be called when a specific line item goes through the right step. What is this hook? Where would I get my nid from step 1 then?

Is this a good approach to take?

With that info I could prob throw something together as a quick proof of concept.

Thanx a 2^20

Anton

tpainton's picture
Offline
Joined: 06/03/2008
Juice: 2
What a great idea..

Well.. I have been stumbling on this for about a year. Such a simple concept.

A website sells information.

Each node is a block of information with a Teaser..

User pays to view the rest of the information and has access to it forever..

I have tried it with views, signup, event, etc etc. There is no perfect solution. There are tons of posts requesting this sort of solution on ecommerce site, drupal, etc. It's much needed. Please post up any progress made on this.. Thanks.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: What a great idea..

I wrote it already. Eye-wink

http://drupal.org/project/uc_node_access

The 5.x-1.0-dev release is a working version, I was just giving the client who paid for that module time to report any troubles before making an official 1.0 release/announcement.

Daniorama's picture
Offline
Joined: 09/15/2008
Juice: 46
Re: Re: What a great idea..

Could the module be ported to Drupal6? Thank you!