• Resolved helfgar

    (@helfgar)


    Since the Admin can change the token, I would like to know if there is a possibility that the user can change it. Because I want to make it available for the user to edit whatever he wants in the referal link. EX .: https://www.site.com?ref=myname

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hello there,
    hope you are doing well! ??

    Unfortunately, at the moment it’s not possible, sorry, only the admin can modify the token.

    Anyway, if you want, you can use the next code (adding it to the functions.php of your theme) to generate the token using the affiliate login name:

     if( defined( 'YITH_WCAF' ) && ! function_exists('yith_wcaf_change_affiliate_token' ) ){
    function yith_wcaf_change_affiliate_token( $token, $user_id ){
    $user = get_user_by( 'id', $user_id );
    
    if( $user && ! is_wp_error( $user ) ){
    $token = $user->user_login;
    }
    
    return $token;
    }
    add_filter( 'yith_wcaf_affiliate_token', 'yith_wcaf_change_affiliate_token', 10, 2 );
    }

    If you have any doubt let us know and we will be happy to help you.

    Have a nice day!

    Thread Starter helfgar

    (@helfgar)

    When I click on any of these links (Commissions, Clicks, Payments, Generate Link and Settings) the page opens with error 404. Why is that? Do I need to install another plugin?

    Plugin Author YITHEMES

    (@yithemes)

    Hello there,

    Thanks for contacting us and I hoep you’re doing well ??

    Seems you need to refresh the permalinks on your WordPress.

    Click on settings > permalinks and click on save changes button.

    Please, check it and let me know.

    Have a good day.

    Plugin Author YITHEMES

    (@yithemes)

    Hello there,

    I am setting this topic as solved for now as we have no more news from you.

    But please, feel free to open a new one at any time to receive additional support on any other issue.

    Have a great day!

    Its not working on my site

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change token’ is closed to new replies.