If you wish, you can embed the HTML code of your PostAffiliatePro signup form on your own website and allow visitors to signup as affiliates directly from your website. To do so, navigate to Configuration --> Affiliate signup --> HTML form tab. Here you can download the code of the signup form. You have 3 options which you can use:
Simple HTML
- Can redirect to different pages on success or error
- Errors can be displayed only on the default signup form or using PHP on the error page URL
HTML + PHP
- Can redirect to different pages on success or error
- Errors can be displayed only on the default signup form or using PHP on the error page URL
HTML + JS/jQuery
- Errors are automatically displayed directly on the form without any redirection
- You can code various success actions, not only redirection to specific page
- Doesn't require PHP which you usually can't use with cloud based services
The code with a preview gives you a basic idea of how the signup form should look like. You can customize the form the way you need, but you have to keep the given input field names. Actually, the HTML form inherits the field settings applied at Configuration --> Affiliate Signup --> Fields tab.
Documentation
HTML + JS/jQuery
In the case of jQuery it is necessary to find and relpace the https://www.SuccessUrl.com/ with the URL address you want to display to the affiliate after his account is successfully created. An experienced developer can easily customize the code to display a pop up with success message instead of redirection or customize the code some other way. Please note that changing the functionality of this code requires advanced programming skills and an understanding of the code/comments.
As there is no errorUrl in jQuery code, it isn´t required to provide such a page that should be displayed if the registration ended with error. Error messages are displayed directly in the signup form.
Simple HTML / HTML + PHP
The HTML signup form must be sent to /affiliates/signup.php after signup. Then there are two modes of operations. If you don't include the errorUrl,successUrl hidden fields, the form will be processed by standard signup form.
If there are some errors, they will be displayed in the standard signup form. If you want to be sent back to the HTML signup form in case of error, you have to add hidden field errorUrl to the form and this file has to be PHP! Then the error messages and all values will be sent back by POST method to the URL you specified in errorUrl hidden field
Possible HTML form parameters (as hidden fields)
errorUrl | URL where the data should be sent in case of error. It should be URL address of the HTML signup form |
successUrl | URL where the data should be sent when signup is successful. It will override any setting from merchant panel. It can be "thank you for signup" page. |
Data returned to successUrl or errorUrl
cumulativeErrorMessage | all (optional) error messages grouped together in on string |
successMessage | success message |
list of fields | list of signup form fields returned with the value sent and (optional) error message. Example: username - contains value entered by user usernameError - contains error message for this field firstname - contains value entered by user firstnameError - contains error message for this field |
Further customization possibilities:
Assign affiliate to campaign at signup
- activate the "Signup affiliate automatically to campaign" plugin in Configuration --> Plugins
- add a hidden input field with name "a_cid" to your signup form. This field must contain the ID of the campaign to which the new affiliate will be signed up.
- If you wish to use a custom login form, check it out here.