Affiliate Registration issue

Posted in

Hi, I have a situation where I need to add information to registered users after they’ve registered. The type of information needed to be added is actually html. Its a simple html form.

I currently have a working method where I am using the ninja forms integration and it does pass my html form into a custom field and populates that code via shortcode based on affiliate id. However, the form actually requires the affiliate url link so this information can’t exist until the affiliate is already registered.

So I need to figure out how I can update this information after the user has been registered so I can add the info the form requires. I don’t see any way to update user info from ninja forms and have it update info to the affiliate user profile and being that it is html, the user profile will not update this because it is only designed for text field use.

Any suggestions as to how I can make this work?

7 Responses to Affiliate Registration issue

  1. Riche May 25, 2018 at 5:28 pm #

    No, the affiliate does get registered. The point of this code is to get the input value and a couple other custom fields that I add into the the registration of the new affiliate. I generate these as shortcodes and place them into a capture form which is supposed to change like 4 input values based on the affiliate. It works but when inspecting the elements from chrome into this form I’ve created it shows as shortcodes as it probably should but it doesn’t pass the information into my plugin and save these attributes into the db. I can get the form to redirect successfully to the correct page when the form is filled out but it is not actually saving any data from the shortcodes created. I think this may be because somehow instead of seeing the shortcode as a shortcode, the ouput needs to somehow actually output the value of the processed shortcode before the form gets submitted.

    I’ve really been searching for answers for days and it seems the reason one of the functions work but the others do not is because the one that works has method=”post” so it is firing that shortcode but the others fail. There may be no solution to what I’m trying to do. I don’t know…

    • Kento August 5, 2018 at 12:42 pm #

      To be honest this sounds tricky, I’m not sure how I could help you further with it as it’s very customized and specific to your case. Sorry for the late reply, I honestly just got to see your message. I hope that you have been able to find a solution.

  2. Kento May 25, 2018 at 5:15 pm #

    Ok I’ve checked this and I think the issue here is that you try to obtain the affiliate ID before the affiliate has registered, please correct me if I’m wrong about that, but based on:

    $affiliate_id_input_value = Affiliates_Service::get_referrer_id();

    … what this does is provide you with the referrer’s ID and not with the new affiliate’s ID.

    You can’t get the new affiliate’s ID until the account has been created, thus my previous suggestion to render the form within a dedicated page once the affiliate is registered.

  3. Riche May 23, 2018 at 2:18 pm #

    Sorry, I see the form doesn’t paste in this text block.

    • Kento May 25, 2018 at 5:10 pm #

      Thanks Riche, I’ve moved the code to a gist – checking …

  4. Riche May 23, 2018 at 2:16 pm #

    I’ve decided to not try using an entire html block to render via shortcode onto the page but instead I”m trying to just take the important parts of the form and place individual shortcodes where they are. Here is an example:


    This is not the actual form in its entirety but an example.

    The form action decoded would render a url like this which works but other shortcodes within this shortcode seem to simply display as a shortcode which never gets deciphered by the form plugin. I’m guessing because it needs to ouput as text instead of a shortcode. (edited: moved code to gist)

    Any suggestion on how I can get this one to output as text when I inspect the element?
    Unless I’m looking at this wrong?

  5. Kento May 22, 2018 at 4:48 pm #


    Thanks for the detailed explanation!

    I think the only feasible solution is to render the info dynamically once the affiliate has been registered. If you take the affiliate shortcodes and use them to render the form within a dedicated page, then you would simply need to point the affiliates to that page from the affiliate area.


We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account