Tips and Tricks HQ Support Portal › Forums › WP Affiliate Platform › Non Affiliated to default affiliate or selected in random
Tagged: default affiliate
- This topic has 29 replies, 7 voices, and was last updated 8 years, 8 months ago by syukri.
-
AuthorPosts
-
June 23, 2014 at 7:56 am #49334adminKeymaster
Which shortcode are you using to show the name?
June 23, 2014 at 2:20 pm #49335wrcaccessSpectator[wp_affiliate_referrer_details info=”firstname”] [wp_affiliate_referrer_details info=”lastname”]
June 23, 2014 at 10:57 pm #49336adminKeymasterokay that shortcode can’t function if an actual referrer value doesn’t exist for the user.
You could do the following to tweak it:
Open the “wp_affiliate_platform1.php” file and look for the following block of code:
if(empty($ap_id)){
return AFF_NONE;
}Now, change it to something like the following to assign the default affiliate ID to the $ap_id variable:
if(empty($ap_id)){
$ap_id = "your default affiliate id value";
}That should do it.
June 24, 2014 at 3:21 am #49337wrcaccessSpectatorThanks Admin,
I already did that with your earlier code input as mentioned.
Anyway, here is where to modify the plugin.
Open the “wp_affiliate_platform1.php” file and look for the following line of code:
$referrer = AFF_NONE;
Thanks for the time and support you give. TT HQ is unlike any other after sale support system in all of the Internet. 17 years online and no other business treats its customers like gold as you guys do. Thanks!
Now, you can assign any value to the variable and it will use that.
The ref id shows just fine.
January 12, 2015 at 7:28 pm #49338bmccarthyMemberI created a shortcode for “assign a referrer to me” cases where one doesn’t exist.
if(isset($_POST)){
$referrer_id = strip_tags($_POST);
record_click($referrer_id);
}
function wp_aff_set_affiliate_id_formrd()
{
$output = “”;
if(!isset($_POST)){$_POST=””;}
$output .= ‘<form method=”post” action=”#aff_id_entry_anchor”>’;
$output .= ‘<input name=”wp_aff_affiliate_id” type=”hidden” size=”20″ value=”your_value_here”/>’;
$output .= ‘<div style=”padding-top:5px” class=”submit”>’;
$output .= ‘<input type=”submit” name=”wp_aff_affiliate_id_submitrd” value=”Assign me an affiliate” />’;
$output .= ‘</div>’;
$output .= ‘</form>’;
return $output;
}
January 13, 2015 at 5:43 am #49339adminKeymasterThank you for sharing your solution.
March 2, 2016 at 2:17 am #49340syukriMemberHi,
I have been trying to set a default affiliate (when there is no supplied affiliate ID on the URL) without any success. I have followed all instructions at https://support.tipsandtricks-hq.com/forums/topic/non-affiliated-to-default-affiliate-or-selected-in-random without any success. What did I do wrong?
I have modified (at “wp_affiliate_platform1.php” file):
$referrer = AFF_NONE;
to
$referrer = ‘xxx’;
where xxx is the default affiliate.
Thank you for your respond.
March 2, 2016 at 2:24 am #49341wzpModeratorTry clearing all of your browser cookies. If the browser you are using to test, already has an affiliate cookie set, the default will not take effect.
March 2, 2016 at 2:53 am #49342syukriMemberThank you for your respond. I have cleared all cookies, but the default affiliate is still not set. If you have time, please visit [http://halalmartku.com/], see the text on the bottom page, still shown as ‘None’.
I have used:
Affiliate ID: [wp_affiliate_referrer_details info=”refid”]
to show the current affiliate ID.
Thank you.
BTW:
If you go to [http://halalmartku.com/?ap_id=test], the affiliate is set.
March 2, 2016 at 11:23 pm #49343adminKeymasterThere are a few occurrences of the “AFF_NONE” keyword in that file. All of those need to be changed.
So it is better of you do this change by customizing the language file. You can customize the value of the “AFF_NONE” keyword in the language file:
So you would change the following:
define('AFF_NONE', 'None');
To the following:
define('AFF_NONE', 'xxxx');
xxxx is the default affiliate ID in this example.
March 3, 2016 at 1:41 am #49344syukriMemberI have modified
if (empty($ap_id)) {
return AFF_NONE;
to
if (empty($ap_id)) {
return xxxx;
Where xxxx is the default Affiliate ID, but still has no effect.
March 3, 2016 at 10:41 pm #49345adminKeymasterI will take a look at your code to see what you have done. I have sent you an email for it.
March 4, 2016 at 12:14 am #49346syukriMemberThanks. I have replied your email.
March 4, 2016 at 2:00 am #49347adminKeymasterYou had TWO separate copies of the affiliate plugin in your plugins menu. You were modifying the one that was inactive!
March 4, 2016 at 3:23 am #49348syukriMemberHi again,
I deleted the Affiliates WooCommerce Advanced Integration plugin and then reinstall it. Somehow, my website has now working as I want. My website now shows affilate name, phone etc and also different product has different commision rate.
Thank you for your support. You are the best! Very recommended programmer and support!
-
AuthorPosts
- You must be logged in to reply to this topic.