Vote up!
Vote down!

How can I restrict available products per customer?

A client asked me to work out this commerce setup, but I was wondering if this is possible:

- shop only for clients, not for public.
- only 50 products

showing products is different for each client profile:
client A sees product 1,2,4
client B sees product 2,5,7
client C sees product 1,4,5,9

The number of clients is limited (max 15).
Is it possible to link a client to certain products in a simple way? Maybe by browsing to a client's profile and tick the products he's allowed to see?

Is it also possible to link different shipping methodes to different clients?

Asked by: Kris Obbers
on June 5, 2013

1 Answer

Vote up!
Vote down!

Is it too cliché to say anything's possible?

In your case, it would be just fine to add a product reference field to the user account and use the value of that field to filter a list of products they're allowed to purchase. You can do that using the Field UI and Views.

To prevent customers from somehow adding a product to the cart that they shouldn't have, I'd probably also use Rules to ensure they aren't trying to buy a product not in their list. I don't have a ready answer for how I'd build such a Rule, but it should be possible. If not, I'd just write a custom Rules action to take care of it.

Because there is no shipping service reference field, you'll need to create an "Available shipping service" select list field on the user account and manually populate it with your different shipping service options. Then use a condition in the shipping services' rules components that checks to see if the current service has been marked available. So, it's possible, just a little trickier than restricting products shown in a list.

Ryan Szrama
Answer by: Ryan Szrama
Posted: Jun 6, 2013