Affiliate portal shortcode
Solid Affiliate comes with a collection of shortcodes to give you control over the Affiliate Portal components.
Solid Affiliate comes with an automatic way to create a page and embed the [solid_affiliate_portal]
shortcode during the setup wizard. You can use these shortcodes on any page of your site, as many times as necessary to accomplish your goal.
Overview Video
We recommend watching this video recorded by our team which walks you through the shortcodes and shows you a live example use case. By the end of the video you’ll know everything you need to know.
[solid_affiliate_portal]
The [solid_affiliate_portal]
shortcode renders the entire Affiliate Portal, including the registration form and affiliate login form unless you edit the Affiliate Portal settings. You must use this shortcode somewhere to render the affiliate portal. You can disable the login and registration forms from rendering via this shortcode in Affiliate Portal settings, and then use the below shortcodes for fine-grained control.
Note: This shortcode also takes an affiliate_group_id
parameter. Setting this will cause any affiliates who register through the form to be assigned to the respective affiliate group. You must ensure that the ID is correct and that the group exists. Example [solid_affiliate_portal affiliate_group_id="3"]
[solid_affiliate_portal_login]
The [solid_affiliate_portal_login]
shortcode renders just the Affiliate Portal login form.
[solid_affiliate_portal_registration]
The [solid_affiliate_portal_registration]
shortcode renders just the Affiliate Portal registration form.
Note: This short-code also takes an affiliate_group_id
parameter. Setting this will cause any affiliates who register through the form to be assigned to the respective affiliate group. You must ensure that the ID is correct and that the group exists. Example [solid_affiliate_portal_registration affiliate_group_id="3"]
[solid_affiliate_if_referred_by_affiliate ]
To conditionally display something to a visitor if they have been referred by an affiliate, you can use the [solid_affiliate_if_referred_by_affiliate]
shortcode. This shortcode also takes an field
parameter to conditionally show the current referring affiliate’s full name, or their username.
[solid_affiliate_current_affiliate field="fullname"]
displays display the affiliate’s fullname.[solid_affiliate_current_affiliate field="username"]
displays the affiliate’s username.
Example of conditional rendering
[solid_affiliate_if_referred_by_affiliate ]
You’re shopping with [solid_affiliate_current_affiliate field="fullname"]
!
[/solid_affiliate_if_referred_by_affiliate]
[solid_affiliate_current_affiliate_link]
Checks to see if the current user is an affiliate. If they are, it returns the default affiliate link for them. Otherwise, it returns an empty string.
Use case: “I would like to insert this shortcode on my site, and a link like this should appear: https://mydomain.com?sld=affiliateid”
[solid_affiliate_current_affiliate_coupon_code]
Overview
The solid_affiliate_current_affiliate_coupon_code
shortcode is designed to check if the current user is an affiliate and, if so, to return their associated coupon code. This shortcode is highly flexible and provides different fallback messages depending on the user’s affiliate status and coupon code availability.
Usage
To use the solid_affiliate_current_affiliate_coupon_code
shortcode, insert it into your WordPress post or page editor. You can customize the shortcode’s behavior using the attributes explained below.
Shortcode Format
[solid_affiliate_current_affiliate_coupon_code
no_affiliate_message="Your custom message here" no_coupon_code_message="Your custom message here"]
Attributes
no_affiliate_message
(optional): This is the message displayed if no affiliate is found for the current user. If not specified, a default empty string (“”) is used.no_coupon_code_message
(optional): This is the message displayed if the user is an affiliate, but there is no coupon code associated with them. If not specified, a default empty string (“”) is used.
Examples
- Basic Usage (with default messages):
[solid_affiliate_current_affiliate_coupon_code]
This will display the coupon code or default messages based on the user’s affiliate status and coupon code availability. If there is a coupon code, it will simply return the actual code such as “DISCOUNT-25” for example.
- Custom No Affiliate Message:
[solid_affiliate_current_affiliate_coupon_code no_affiliate_message="Sorry, you are not an affiliate."]
This will display “Sorry, you are not an affiliate.” if the user is not an affiliate.
- Custom No Code Message:
[solid_affiliate_current_affiliate_coupon_code
no_coupon_code_message
="Affiliate status confirmed, but no code found."]
This will display “Affiliate status confirmed, but no code found.” if the user is an affiliate without a coupon code.
- Custom Messages for Both Scenarios:
[solid_affiliate_current_affiliate_coupon_code no_affiliate_message="Become an affiliate today!"
no_coupon_code_message
="Contact support for your unique code."]
This provides custom messages for both scenarios: when the user isn’t an affiliate and when an affiliate lacks a coupon code.