I’m using Buddypress on a WordPress multisite install. My goal is to have different extended profile questions based on what site the user is a member of. I’ve achieved that by using the Member Type Generator plugin. Each of my sites has one member type ( site name – member). I want users to automatically be assigned to this type upon Woocommerce registration. Is there a way to do this? Members are not filling out their extended profile during Woocommerce registration. I don’t want people to register and go to their account and not see any profile fields because they have to wait on me to assign their type.
Hi Allison,
Welcome to BuddyDev.
Do you have any way to know which member type a user should be assigned at the time of registration. If yes, Then It can be easily done.Please let me know and I will post the code.
Thank you
BrajeshHi,
Just to be clear, for member type the key is important(the unique key that you set while creating). To assign a user to a member type we need to know that unique key for the current site.ewpeergroupmember? Here is a screenshot incase that is incorrect https://www.equipmentworldpeergroup.com/wp-content/uploads/sites/3/2016/05/Screen-Shot-2016-05-25-at-1.27.42-PM.png
Hi,
I am sorry I missed your post. I will be putting code in next couple of hours.Thank you
BrajeshHi Allison,
Please use the following codefunction buddydev_set_membertype_on_wc_register( $user_id, $user_data ) { //decide which member type $member_type = "whatever";//PLEASE UPDATE IT bp_set_member_type( $user_id, $member_type ); } add_action( 'woocommerce_created_customer', 'buddydev_set_membertype_on_wc_register', 10, 2 );
Please make sure to update the $member_type with the correct value and the user will be assigned the member type.
You must be logged in to reply to this topic.