• Resolved mhogo

    (@mhogo)


    Here is my problem. I work for a client who has a sports site. the client’s site includes a member area which allows students to register. they only have a role of subscriber. As for the coaches, they have an editor role where they can modify things, change the schedule for students etc …

    , I used the profile builder plugin from Cozmoslabs which makes the job a lot easier when creating a member’s area.

    The problem that I cannot solve is to be able to limit the students who register for the fitness course to 20 places, to the swimming pool course to 15 places. The ideal would be that when the user clicks on register of profile builder, there is a message like “sorry but the number has been reached. Apparently, a code like this could solve the problem but I don’t know how to do it. and which file I should insert it in. I can’t find the function that triggers the registrations so that I can make a logical condition.

    param (login, password, etc …)
    $ req = $ bd-> save (param);
    $ total_users = $ user-> getTotal (), // Get total number of users in database

    if ($ user_total <20) {
    then use the recording function
    }
    else {
    echo “Sorry, the number of authorized users has been reached”
    }

    here’s the registration page link
    http://s810913372.onlinehome.fr/register/

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Georgian Cocora

    (@raster02)

    Hello @mhogo,

    This is possible with some custom code, but we need to differentiate between the forms somehow.

    So how do you do it right now ? On your website it seems that you are using the same form in both places. This can work, but you should add the Select User Role field to the form so users choose what they subscribe to.

    We would then hook into this field and validate it, denying the registration if no more slots are available.

    Regards.

Viewing 1 replies (of 1 total)
  • The topic ‘limit the number of registrations’ is closed to new replies.