Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrick1229/cfd87548c66406a2492576b05fd93579 to your computer and use it in GitHub Desktop.
Save jrick1229/cfd87548c66406a2492576b05fd93579 to your computer and use it in GitHub Desktop.
[AutomateWoo - Refer A Friend] Change the advocate ID to 'REF[user_id][first_name]'
<?php
add_filter('automatewoo/referrals/generate_advocate_key', 'my_automatewoo_referrals_generate_advocate_key', 10, 2 );
/**
* @param $key
* @param AW_Model_Referral_Advocate $advocate
* @return int|string
*/
function my_automatewoo_referrals_generate_advocate_key( $key, $advocate ) {
return $advocate->get_id() . "" . $advocate->get_user()->first_name;
}
@imankimver2020
Copy link

imankimver2020 commented Nov 20, 2020

I try it and its not working. Only returns to REF[user_id]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment