Assigning User Roles Based on Registration Code
-
Hello I’m a bit new here but hoping someone can help.
I’m working on an e-commerce site which requires different roles and pricing based upon those roles (bronze, silver, gold etc..) this bit is fine but the client requires during registration if someone has a specific code they can qualify for a higher discountAt the moment I have the UPME plugin working and I’ve created the different user roles bronze, silver and gold. Currently any user signing up will automatically become a ‘Bronze User’which is nice and easy via UPME. Now the client is asking that if a user, with one of about 15 pre defined codes, enters a code in at registration they will be registered as a silver user.
I’ve created a custom field in UPME called registration code. My PHP from scratch is pretty poor but is there a way/loop/function that if the code is present within that field that the user role is defined as something other than the default of the form?
so if registration_code = code12 then user_role= silver?
Does this make any sense?
The topic ‘Assigning User Roles Based on Registration Code’ is closed to new replies.