Tags/topics: 
1
Answers
Vote up!
0
Vote down!

Restrict product to one customer only

I have a specific requirement and am wondering whether and how easy this would be to do in Drupal Commerce.

The Seller creates a product individual to one customer only. Seller creates account for customer and sends credentials to customer.

Customer logs in and checks product, no other customer can see this product, and if they like it approve it. Once approved the customer can buy the product from the Seller.

Now I can suss the customer account creation bit, and in theory you restrict access to the product as a node or entity to one UID (that of the account created above) Then approval is a simple checkbox and Rules then triggers the ability of the customer to buy the product.

So would this be possible in Drupal Commerce and if not why not? Would Ubercart be better?

Thanks in advance for your comments and responses.

Asked by: TechnoTim2010
on November 29, 2012

1 Answer

Vote up!
1
Vote down!

This would be possible in Commerce. The trick would be adding a user entity reference field to the product display. Then, create a rule that fires on every product display view and checks that field's value. If the value doesn't match the user trying to view it, redirect them. Maybe add an "OR" that returns true if the user viewing the product display has a role of administrator.

Josh

Josh Miller
Answer by: Josh Miller
Posted: May 1, 2013