Support » Fixing WordPress » User Register Function on 2 pages

  • Not sure If I am allowed to ask this question here.

    I need assistance on user_register function and how I use it. I have 2 pages for registration, it depends on the user pricing plan that he chose, I have 2 Pricing options. If he chose pricing option 1 he will be directed to registration page 1 and if he chose pricing option 2 he will be directed to registration page 2. Reason for the 2 registration options is I dont know how else to do it. Upon registration the following code will be triggered. Its in a code snippits plugin.

    The 1st If works 100% but not the 2nd If……..

    Can somebody direct me in the right direction. Thanks a lot.

    This are the URL’s for the 2 registration pages:
    https://www.schoolhoppers.co.za/register-unlimited/
    https://www.schoolhoppers.co.za/register-limited/

    This is the code I am using…

    add_action( ‘user_register’, ‘add_new_acount_fields_to_metadata’, 10, 1);

    function add_new_acount_fields_to_metadata($user_id){

    global $page_id;

    $page_id = get_the_ID();

    if($page_id = 208191){

    update_user_meta($user_id, ‘Count_reg_schoolhopper’, 0);

    update_user_meta($user_id, ‘Count_hist_per_schoolhopper’, 0);

    update_user_meta($user_id, ‘Count_view_per_area’, 0);

    update_user_meta($user_id, ‘Cost_model_user_chose’, 1);

    }

    Else

    if($page_id = 210421){

    update_user_meta($user_id, ‘Count_reg_schoolhopper’, 0);

    update_user_meta($user_id, ‘Count_hist_per_schoolhopper’, 0);

    update_user_meta($user_id, ‘Count_view_per_area’, 0);

    update_user_meta($user_id, ‘Cost_model_user_chose’, 2);

    }

    }

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

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘User Register Function on 2 pages’ is closed to new replies.