Skip to:
Content
Pages
Categories
Search
Top
Bottom

Conditional select options are set and assign checkbox selection to user profile


  • adpihamat
    Participant

    @adpihamat

    Hi Everyone

    I’m looking for help with the following logic, if anyone can help it would be greatly appreciated. It is required in the registration and is based on a users selection of a school

    If a user selects a school from the dropdown list ie. School 1, then by selecting that school
    it sets pre-defined groups and assigns the school and the pre-defined groups to the users profile.

    My way of thinking (maybe way off)

    //Input type = select
    School 1
    School 2
    School 3

    //Input type = checkbox
    Group 1
    Group 2
    Group 3
    Group 4

    //Condition: if user selects an option from dropdown field
    if(select id == option value(“School 1”)
    {
    // set these groups checkbox fields as selected
    set group pre-defined-groups(“Group 1”, “Group2”, “Group 4”)

    // assign selected school option to user’s profile
    ??? (select field is only used to allow those groups pre-defined to be used by a new user registering to the site).

    // assign pre-defined-group checkbox field to user’s profile
    ??? (because these groups are set up through buddy press does that mean they should automatically be added)

    }

    if(select id == option value(“School 3”)
    {
    // set these groups checkbox fields as selected
    set group pre-defined-groups(“Group3”, “Group 4”)

    // assign selected school option to user’s profile
    ???

    // assign pre-defined-group checkbox field to user’s profile
    ???
    }

    admins should be able to change school or groups anytime

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)

  • adpihamat
    Participant

    @adpihamat

    Do I need to assign anything or just set the groups based on the selection?


    fazla
    Participant

    @fazla

    Hi, @adpihamat did you find any solution? I am also looking for an exact solution with more details like how can I do it step by step? If you have found any solution please reply it with the answer. Thanks in advance


    danbp
    Participant

    @danbp


    fazla
    Participant

    @fazla

    @danbp thank you for the link , I have installed this plugin but I don’t know why I can’t achieve what I want. Can you please let me know how can I use this?


    danbp
    Participant

    @danbp

    No sorry! If you have difficulty with a plugin, you have to ask on it’s support forum.


    fazla
    Participant

    @fazla

    @danbp I can use that plugin now thank you but that was not what I was looking for. My question was I want to make a profile field on the registration page where I want to add pre made group
    I want to add some groups and then I want members to join in the a particular group while registering


    danbp
    Participant

    @danbp

    See these plugins
    https://wordpress.org/plugins/buddypress-registration-groups-1/

    https://wordpress.org/plugins/bp-auto-group-join/

    but remember you asked first for Conditional select options […] 😉


    fazla
    Participant

    @fazla

    @danbp Yes That is correct, actually I want to make some groups and then when a new user registers I want that group to be a profile field for him and that user will only be able to join one group and that should be at the time of register. For example, I want to make a website where user will get a drop down option to select his favorite game type like arcade, action, sports, racing, music. And after selecting and completing the sign up that will only be a part of one game type. And I will make this game types as groups. if you read the question from @adpihamat you will understand it a bit clear.


    danbp
    Participant

    @danbp

    If you read BP auto join plugin description:
    Optionally determine which group to join based on Member Type, using our BuddyPress Member Types plugin.

    And as you have other conditions, you need Conditionnal profile fileds.

    Field Name Favourite Games
    select

    Condition
    If favourite is racing > Auto join Racing Group, it is music, join group music and so on

    Member Types to create
    arcade, action, sports, racing, music

    But i can’t learn you more. You have to experiment with all this to find the best compromise.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Skip to toolbar