• Resolved 121940kz

    (@121940kz)


    I’ve been using the register helper add on for a while to collect extra information on sign up. However, I am at a point where I now need to ask a separate question(s) based on the membership level. So, what hook or filter can I use where if the level being signed up for is level 1 then display these questions with the register helper, otherwise if level 2, display these questions.

    Since I have it working now with only 1 set of questions for all memberships, I was hoping the php if statement would be easy but so far could not really find the piece of information needed to achieve this.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Andrew Lima

    (@andrewza)

    Hi @121940kz

    Thank you for using Paid Memberships Pro.

    Are these questions created with the Register Helper Add On?

    You should be able to use the 'levels' => array(1,2,3) attribute to show these custom fields based on the checkout level. The above attribute will show the fields for only levels 1,2 or 3. You can create a combination for this.

    Here is our link to documentation and all available attributes per field type – https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/

    Thread Starter 121940kz

    (@121940kz)

    Wow that was a lot easier than I thought! Thank you very much it works perfect, exactly what I wanted. For anyone searching in the future, it would look like this as an example

    $fields[] = new PMProRH_Field(
            "Details1",                     // input name, will also be used as meta key
            "text",                         // type of field
            array(
                "label"=>"Please Enter Your Pet's Name",   // custom field label
                "size"=>100,
                "profile"=>"admins",         // show in admin only
                "required"=>true,
    	    "levels" => array(1,2,3) //Allow this field to show for only these levels
            ));
    • This reply was modified 3 years, 10 months ago by 121940kz.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Register helper’ is closed to new replies.