garfry
garfry
Offline
0
I would like to use {affiliate_link} anywhere in my site so people can post on social media with their affiliate link from the page they are on. It only works if you use it in the marketing area. How do I get the plugin to work anywhere on my site?
Thanks
Responses (5)
  • Accepted Answer

    Monday, March 07 2016, 04:05 PM - #Permalink
    0
    hello,

    there's no such option, to allow this a new system plugin should be created specifically for this task..
    The reply is currently minimized Show
  • Accepted Answer

    garfry
    garfry
    Offline
    Monday, March 07 2016, 04:08 PM - #Permalink
    0
    This is the code in the helper.php that pulls in the affiliate link. Can I use nonumbers rereplacer to replace {affiliate_link_anywhere} with some modified version of this code?

    	static function get_account_link($account_id = null, $ref_word = null){

    $uri = JFactory::getURI();
    $app = JFactory::getApplication();

    if (empty($account_id)) $account_id = self::getCurrentUserAtid();
    if (empty($ref_word)) $ref_word = self::getRefWordFromAtid($account_id);

    if(!empty($ref_word)) {
    $return = $uri->base() . $ref_word ;
    } else {
    $return = $uri->base() . "?atid=". $account_id ;
    }

    if(!$app->isSite()){
    $return = str_replace("/administrator", "", $return);
    }

    return $return;
    }
    The reply is currently minimized Show
  • Accepted Answer

    Monday, March 07 2016, 04:10 PM - #Permalink
    0
    You will have to ask nonumbers about this.. I don't know how their plugin works... :)
    The reply is currently minimized Show
  • Accepted Answer

    garfry
    garfry
    Offline
    Monday, March 07 2016, 04:18 PM - #Permalink
    0
    Well I guess I know that I can replace {affiliate_link_anywhere} with php so it is acting like a plugin. I would just need to know what affiliate tracker code I need to put in there to get:
    [current page url]/?atid=[account id]
    thanks
    The reply is currently minimized Show
  • Accepted Answer

    Monday, March 07 2016, 05:55 PM - #Permalink
    0
    well, you can call the function get_account_link(), as you said, and pass it the ID of the affiliate you want...
    The reply is currently minimized Show
Your Reply