0

I want to create a single user registration/ sign up form for two types of users e.g buyer and seller. When trying to register, a potential user will have the option of selecting between being a buyer or seller. After completing the form and clicking the sign up button, the user who chooses buyer is immediately logged in while the seller is taken to a page where he needs to provide additional information to complete his/her registration. I have downloaded and installed profile 2 and auto assign role but am not sure am on the correct path.

Thanks in anticipation.

2

Sounds like a way to go. Additionally you may use the Rules module to redirect the seller to the profile page and the LoginToboggan module to login users immediately after registration. Also some Spam bot prevention may be useful. Generally I consider registration without user approval (by email) as harmful: A user can easily register himself in the name of another person. Drupals double opt-in usually helps to prevent that. LoginToboggan can delete users which did not approve their registration after x days.

Anyway here is a potentially cooking list:

  • Add two roles: Buyer and Seller.
  • Use the Auto Assign Role module to let the user choose between Buyer and Seller at registration time.
  • Use the LoginToboggan module to login the user immediately after registration.
  • Create a profile for Sellers using the Profile 2 module. Use Drupal permissions to make it accessible by Sellers only.
  • Use the Rules module to redirect Sellers to their profile page if they have no profile yet.
  • Optionally use the CAPTCHA module to prevent spam bot registrations.
  • Thanks! I however now have the following issue: I created 2 roles on my site: Buyer and Seller I used auto assign role to allow the user choose a role on sign up. I then created an additional profile for seller using profile 2. (The buyer is supposed to be logged in immediately he signs up) Using rules, i tried to redirect the user who chooses the seller role to the page setup with profile 2, but it comes up with access denied, you are not authorized to access this page. Kindly assist. – seyi Apr 16 '13 at 15:28
  • sounds like a permission issue, check the permissions for seller role for profile 2 – Fahad Ur Rehman Apr 23 '13 at 8:01
  • My profile 2 path is example.com/seller/register. I believe I get access denied message because the page can only be viewed by anonymous users. Is there a way I can over ride this and grant access to the seller role? I believe permissions are appropriately set. Thank you. – seyi Apr 27 '13 at 20:04
1

You can probably add a Field to the User Accounts for type_of_user and have it be a select box with your 2 options. Require it at registration. Use Rules to say if Registration is submitted with Seller value set -- redirect to another page with other profile fields. If needed you can probably use Display Suite to limit the number of fields shown in the 2nd page for Buyer type users.

Another options is to simply use hook_form_alter in place of Rules for the above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.