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?

5 Responses to Affiliate Registration issue

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

    Hi,

    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.

    Cheers

  2. 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:

    [affiliates_is_referred]
    [/affiliates_is_referred]

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

    The form action decoded would render a url like this https://coolwebsite.com/?wpmlmethod=offsite&list=20 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.

    https://gist.github.com/itthinx/f912ab567a204f2fcbc589c86591f00b (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?

  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. 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.

Share