• Resolved duffldofflo

    (@duffldofflo)


    Hello there, I wanted to ask if there is a way to use a dedicated form plugin (like Formidableforms) to register affiliates?

    Thank you and regards!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author iova.mihai

    (@iovamihai)

    Hey @duffldofflo,

    Thank you for reaching out! I’m afraid that we don’t have a way of integrating with a form plugin to register affiliates.

    Affiliates can only register via the form SliceWP comes with. You can learn more about this here: https://slicewp.com/docs/adding-affiliate-registration-page/

    Even so, can you please let me know why you’d like to use a dedicated form plugin instead of the form provided by SliceWP? I’d love to hear your feedback and add it to our development log for future reference.

    Thank you and best wishes,

    Mihai

    Thread Starter duffldofflo

    (@duffldofflo)

    Hey Mihai,

    thank you for your reply!

    The reason I am asking is that my customer would like to do the following:

    A prospective affiliate visits a landingpage. There is a button “register now”. This button leads to the registration form. The affiliate fills in that form and submits.

    Now, my customer has many affiliate groups and he wants to have many affiliates. So we were looking for a way to automatically assign the affiliate to a group.
    The landingpage is specific for that group. Affiliates that would belong to group A are directed by marketing to landingpage A. B-Affiliates are directed by marketing to landingpage B…So theoretically there could be a way to pass that information to the registration form.
    I got that Idea from Formidable Forms, which has an option to pre populate hidden form fields via url parameter, which is set by the link that leads to that form.

    Regards

    Plugin Author iova.mihai

    (@iovamihai)

    Hey @duffldofflo,

    Thank you for sharing these details! You could do something similar with our registration form. You can use a couple of action hooks to achieve this.

    Firstly, you can add a hidden field in the affiliate registration form, via the “slicewp_form_affiliate_registration” action hook, and populate it from the $_GET superglobal, which takes the information from the URL, like so:

    function slicewp_custom_hidden_affiliate_group_id_field() {

    echo '<input type="hidden" name="affiliate_group_id" value="' . ( ! empty( $_GET['slicewp_form_affiliate_registration'] ) ? absint( $_GET['slicewp_form_affiliate_registration'] ) : 0 ) . '" />';

    }
    add_action( 'slicewp_form_affiliate_registration', 'slicewp_custom_hidden_affiliate_group_id_field' );

    Then you can use the “slicewp_register_affiliate” action, which triggers right after a new affiliate has been registered, to grab the affiliate group ID and set it for the affiliate, like so:

    function slicewp_custom_add_affiliate_to_group_on_register( $affiliate_id ) {

    $affiliate_group_id = ( ! empty( $_POST['affiliate_group_id'] ) ? absint( $_POST['affiliate_group_id'] ) : 0 );

    if ( empty( $affiliate_group_id ) ) {
    return;
    }

    slicewp_set_object_collections( $affiliate_id, 'affiliate', 'group', $affiliate_group_id );

    }
    add_action( 'slicewp_register_affiliate', 'slicewp_custom_add_affiliate_to_group_on_register' );

    I hope this helps!

    Thank you and best wishes,

    Mihai

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Registration form – use dedicated form plugin?’ is closed to new replies.