8 replies [Last post]
innovafire's picture
Offline
Joined: 02/08/2009
Juice: 18
Was this information Helpful?

Hi. I offer web design services and would like to create a product that is only seen by one customer. I.E. a unique bill for THAT customer, not viewable by any other customer. Obviously each project is billed by the services offerred, so cookie-cutter products will not work for me.

Is there a way to do this?

Thanks.

Chris

yesct@drupal.org's picture
Offline
Uber Donor
Joined: 11/18/2008
Juice: 294
Re: Billing module or restricting product to one user?

I think there are probably a few ways.

One that comes to mind is to use taxonomy (sometimes in the admin content area as catagories). And have a vocabulary called clients, and the terms in the vocabulary would be the client name (or unique ID). Then use the taxonomy access module to give a user (or more than one user if the client is a large group) permssion to view nodes (products) that are classifed with a certain term.

Hope that helps, CT

yesct@drupal.org's picture
Offline
Uber Donor
Joined: 11/18/2008
Juice: 294
Taxonomy access control lite.

Taxonomy access control lite is the module I was thinking of.

innovafire's picture
Offline
Joined: 02/08/2009
Juice: 18
Re: Taxonomy access control lite.

THANK YOU! Worked like a charm!

OK I have one last thing on this that you might be able to steer me on.

I would like to make it so that, when the client purchases the product (in other words, pays the bill) that the Taxonomy access term that the product was associated with (let's say it was "Bob"), changes to "Paid item", effectively removing it from that client's catalog.

I thought maybe the triggers module would be good for this, but haven't been able to figure out how.

Either that or if there was a way to just allow a product to be purchased once by a user.

Or if a stock level=0 removed the product from being viewable in catalog.

Chris

splash112@drupal.org's picture
Offline
Joined: 04/01/2008
Juice: 413
Taxonomy light

@innovafire

So you will be making a taxonomy term per customer? Might be nice for now... But might get crowded when you get lots of them.
Still looking for a solution that taxonomy light can grant view permissions per user per product on a special term.

yesct@drupal.org's picture
Offline
Uber Donor
Joined: 11/18/2008
Juice: 294
Re: Taxonomy light

Yeah, I'm hoping someone posts another method. Smiling I'm curious Smiling
The tac lite won't bad for tens of customers but I can't see it working for thousands.

For getting a clients catalog to not show zero stock items... I'm not sure if there is a catalog setting, but I'm thnking I would try a view, and set the view to depend on the number in stock... Then set a custom menu for catalog equal to the view... So that might involve turning off the default catalog.

But I have not tried this idea...

I'm not sure about using conditional actions for this. I'm having trouble getting CAs to fire on entrance into a certain order status...
And I think you would have to write a action for changing term on a product, or change tac lite permissions on a user.. Maybe a CA user could respond?

If it were me, I'd try the views solution first.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Taxonomy light

Another option here is to use ACL + Content Access. This module lets you restrict access to nodes on a per-user basis quite easily. What you'd do is create a new product class for these client specific products. Then go to your content type settings and make it so the default access control settings show that nodes of this type are not visible by anonymous/regular authenticated users... make sure you check the box that lets you override the settings on a per-node basis. Then when you create the node, you can go to the access tab and add the appropriate user to the view list.

Now, as for automatically revoking their access once they pay... that's a little trickier. Eye-wink

You'll need a custom module that uses the ACL API to remove the user from the node's view list when they checkout... this means you might need a custom action or something that can look at the products on the order, determine their node type, and update the access control lists accordingly. We can talk about that further if any of this makes sense to you. Sticking out tongue

innovafire's picture
Offline
Joined: 02/08/2009
Juice: 18
Re: Re: Re: Taxonomy light

Thanks for the recommendations. Doesn't sound from your answers that there is a way to handle the removal of the product without getting into altering the code myself. Maybe the views suggestion I'll look into at some point...

I have an idea of how this would be done SQL-wise, but I'm not yet familiar enough with the inner development structure of Drupal to even know where to look to alter the code at this point. For the time being I'll just remove the products manually, and worry about solving it in the future. Right now my workload on this would be minimal, so it isn't an issue. Maybe by then someone will have come up with a solution, or I'll be Drupal-savvy enough to make one myself!

Chris

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Re: Taxonomy light

Well, from personal experience, it shouldn't be too difficult. I know there's a function in the ACL API that you can call to do this, as I had to implement it for my UC Node Access module... I just didn't have it off the top of my head. Smiling