-
Author
-
September 4, 2013 at 09:30 #2204jaybiniParticipant
After a user registers, How can I make the user apply automatically in a specific membership plan ?
September 4, 2013 at 13:28 #2216HarvinderParticipantYes I would like to do the same.
When a user registers they are automatically in the “Free” membership level.
Then they have the option to upgrade.
September 4, 2013 at 21:36 #2261SQadminKeymasterHi,
We’ll look into it. You could just not create the FREE level and assume it as free if a user hasn;t applied for a levelHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 4, 2013 at 21:46 #2263HarvinderParticipantHi,
Yes I could do that but then I don’t have the option to restrict functionality as they are not in a level?
September 4, 2013 at 23:10 #2275SQadminKeymasterYes you do have the option in Membership -> Advanced to check Logged in or Not Member(this is a user that hasn’t subscribed)
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 12, 2013 at 16:50 #2727SQadminKeymasterHi,
This is the function you need to add in order to assign a specific membership level to a newly registered user. Add it into your sweetdate-child/functions.phpCOPY CODEadd_action('user_register', 'kleo_pmpro_default_level'); function kleo_pmpro_default_level($user_id) { pmpro_changeMembershipLevel(1,$user_id); }
This one assigns level with ID 1
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 30, 2013 at 18:22 #5411SQadminKeymasterAlso this code checks for a specific profile value and add only those users to the membership level:
COPY CODE/** * When registering, add the member to a specific membership level * based on the field value he has selected * * @global object $wpdb * @global object $bp * @param integer $user_id */ function kleo_pmpro_default_level($user_id) { global $wpdb, $bp; //Change this with your field name $field_name= "I am a"; //Change the field value $value_to_match = "Woman"; //Membership level id $membership_level = 1; //Done editing $field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", $field_name ) ); if ($_POST['field_'.$field_id] == $value_to_match) { pmpro_changeMembershipLevel($membership_level, $user_id); } } function kleo_mu_pmpro_default_level($user_id, $password, $meta) { global $bp, $wpdb; //Change this with your field name $field_name= "I am a"; //Change the field value $value_to_match = "Woman"; //Membership level id $membership_level = 1; //Done editing $field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", $field_name ) ); $field_value = $meta['field_'.$field_id]; if ( $field_value == $value_to_match ) { pmpro_changeMembershipLevel($membership_level, $user_id); } } if (is_multisite()) { add_action( 'wpmu_activate_user', 'kleo_mu_pmpro_default_level', 10, 3); } else { add_action('user_register', 'kleo_pmpro_default_level'); }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 4, 2013 at 19:31 #5865djtreble12ParticipantHow do i fix the last code listed above? (checks for a specific profile value and add only those users to the membership level)
when i add it i get a blank white screen i dont think its closed….. when i remove the code the site works correctly
November 4, 2013 at 19:53 #5867JohnDoeParticipantHow to add ur second code so i give men for example the free ID automaticly , and woman a different ID
November 5, 2013 at 00:17 #5885dlcjonathanParticipanti get the blank white screen too…can you explain how to make this work. thanks
November 5, 2013 at 11:19 #5908SQadminKeymasterThe code will be something like:
COPY CODEfunction kleo_pmpro_default_level($user_id) { global $wpdb, $bp; //Change this with your field name $field_name= "I am a"; //Change the field value $value_to_match = "Woman"; //Membership level id $membership_level = 1; //Done editing $field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", $field_name ) ); if ($_POST['field_'.$field_id] == $value_to_match) { pmpro_changeMembershipLevel($membership_level, $user_id); } elseif ($_POST['field_'.$field_id] == "Man") { pmpro_changeMembershipLevel(OTHER_LEVEL_ID, $user_id); } } add_action('user_register', 'kleo_pmpro_default_level');
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 5, 2013 at 11:20 #5909SQadminKeymasterIf you are getting the blank screen then you are not copying the whole code
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 5, 2013 at 16:00 #5955JohnDoeParticipantAnd , how do i give my users that allready registered free user to all now? cos all my other registered users got no membership .
November 5, 2013 at 20:56 #6019SQadminKeymasterManually from Membership – Members 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 5, 2013 at 20:59 #6023JohnDoeParticipantno , that only shows the people who allready have a membership ID , i want to make people without a memberships ID to a Free user , ID 2
November 5, 2013 at 21:12 #6032SQadminKeymasterOh. you are right 🙂
I meant Users – Edit user – Set membership thereHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 5, 2013 at 21:17 #6036JohnDoeParticipantO , alot of work.. :p but if that is what it takes, then let’s go! :p lucky i didn’t have a big database yet .. i read something btw like this :
Ok , so running this sql query works on my local setup:
SELECT * FROM wp_users WHERE 1;
UPDATE wp_users SET user_level=’2′;To actually edit the users table in phpmyadmin
March 18, 2014 at 00:24 #12901AbeKeymaster@harryshapes Level id’s start from number 1 and you see the id in Memberships – Levels. That id that you want to assign to female members you need to change in that code
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.March 31, 2014 at 01:50 #13913StevenParticipantHi All, ( specially Robert for your Code above ) I am trying to create a website where only men have to pay for any membership, while women get free access and all functions. Is there a way I can just charge men for all levels of memberships, and not charge women for anything? I would really appreciate anyone’s help with this matter please and if you could tell me a little on how to do this as my coding skills are very limited.
Thanks,
Steve
April 1, 2014 at 23:56 #14080AbeKeymasterHi, The code from this post does just that. https://archived.seventhqueen.com/forums/topic/membership-auto-in-registration/#post-5411
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.April 2, 2014 at 00:38 #14092StevenParticipantHi Robert, thanks, I got the women free part, how about men cannot see other mens profile, is this possible please? Its like a confidential thing between men. If they purchase a premium package, then they may see other mens profile, but for a free membership, I would love if its possible not to allow this.
April 2, 2014 at 21:38 #14169AbeKeymasterHi, That is not achievable with the default functionality but can be done only with some custom code that you have to develop. If you do not have programming knowledge you can hire a developer from sites like microlancer.com
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.April 6, 2014 at 11:51 #14451dojogeParticipantI would like to send users to the membership levels page immediately after registration. Is this possible?
April 9, 2014 at 18:37 #14712AbeKeymasterHi, There are plenty resources out there. See: http://wordpress.stackexchange.com/questions/18301/redirect-after-registration-in-buddypress
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.April 14, 2014 at 17:35 #15051AbeKeymasterIt says that you have to put it in sweetdate-child/functions.php That is on your server in wp-content/themes
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 18, 2015 at 20:28 #42550mlennox10ParticipantHi there,
I’ve tried to follow this thread but cannot find the setting described above.
Yes you do have the option in Membership -> Advanced to check Logged in or Not Member(this is a user that hasn’t subscribed)
To be clear, my site is a FREE site (but only for members). So when a user registers and is approved, I want them to have access to all areas of the site. But when a non-member or not-logged-in member, visits my site I want to restrict the forum, member viewing etc.
All help would be really appreciated and i’m running KLEO.
Thanks
January 22, 2015 at 16:51 #43030AbeKeymasterThen you don’t need a membership plugin @mlennox10
but maybe a plugin like: https://wordpress.org/plugins/buddypress-members-only/Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 22, 2015 at 19:22 #43072mlennox10ParticipantThanks @abe but as far as I can see that locks my whole site down. I want to draw members in through the blog and events, but commenting and forum participation are locked down.
As above, can you tell me what you meant by this:
“Yes you do have the option in Membership -> Advanced to check Logged in or Not Member(this is a user that hasn’t subscribed)”
Because that’s what I’m after..
January 26, 2015 at 17:11 #43473AbeKeymasterThen you can install paid memberships pro but don’t configure any membership levels and just configure our restrictions to buddypress from Sweetdate – Memberships
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.February 7, 2015 at 18:14 #45097tdarnoldParticipantI copied the code to functions,php but am getting an error message and can see the code at the top when logged in. I know absolutely nothing about php but am thinking it has to do with a closing tag. around the code
February 7, 2015 at 18:20 #45098tdarnoldParticipantFound the problem. I see now where the code should be inserted before the php closing tag.
May 27, 2015 at 19:07 #60341harryshapesParticipantHi,
Tried to use the code above and I am not sure if its because things have been updated since the code was given but now when pasting it fully into the functions.php section of the theme it shows the code at the top of the website with a white background and my website underneath..
please advise.. thanks a lot!
June 8, 2015 at 00:08 #61477AbeKeymaster@harryshapes you probably have a typo in your code. you need basic php knowledge for that. try to inspect the code and make sure is copied ok
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.July 9, 2015 at 21:10 #67551AbeKeymaster@gagdiversion
please open a new topic since it is now related to this discussionHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.December 28, 2015 at 08:13 #95391gugga7ParticipantHello, is this code still accurate? I copied it in functions.php for the Child theme, I changed the membership level ID but nothing happens when a new user registers.
COPY CODEadd_action('user_register', 'kleo_pmpro_default_level'); function kleo_pmpro_default_level($user_id) { pmpro_changeMembershipLevel(1,$user_id); }
December 28, 2015 at 23:25 #95507AbeKeymasteryes that code should work when users register.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer. -
AuthorPosts
You must be logged in to reply to this topic.