- This topic has 1 reply, 2 voices, and was last updated 9 years, 11 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP Affiliate Platform › Only prompt to set affiliate ID if empty
Tagged: affiliate id
I am going to be using some functions described in this article to mimic “self-replicating sites” (since I can’t seem to find a wordpress plugin for that). https://support.tipsandtricks-hq.com/forums/topic/manually-setting-the-affiliate-id-and-showing-the-affiliate-id-of-the-referrer
Here’s what I’d like to do.
In my header, I want to display the Affiliate ID, First and Last name, and email address of the affiliate by using [wp_affiliate_referrer_details info=xxxx].
However, if the person landed on our page and wasn’t referred by an affiliate, it want a message (ex: “Affiliate ID required before purchase”) to appear along with the form generated by [wp_aff_set_affiliate_id].
Can you help me out on how to tell WordPress if [wp_affiliate_referrer] is blank, display [wp_aff_set_affiliate_id] instead?
Here is a PHP code example for it:
$referrer = wp_affiliate_get_referrer()
if(empty($referrer)){
echo wp_aff_set_affiliate_id_form();
}