Created
May 29, 2018 01:33
-
-
Save danielbitzer/d84a648cd83020dc8b04636154344219 to your computer and use it in GitHub Desktop.
[Refer A Friend] Team based referrals, such as for Teams for WooCommerce Memberships
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'automatewoo/referrals/advocate_id', 'my_filter_automatewoo_advocate_id_for_team_leader' ); | |
/** | |
* @param $user_id | |
* @return int | |
*/ | |
function my_filter_automatewoo_advocate_id_for_team_leader( $user_id ) { | |
// check if the user is a member of a membership team and not the owner | |
// if they are, then return the user ID of the team leader and then | |
// all team members will be sharing on behalf of their team | |
// referrals and store credit will be owned by the team leader | |
// INSERT TEAM LEADER LOGIC HERE | |
return $user_id; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment