Created
May 14, 2021 13:04
-
-
Save cartpauj/5452b5b92c1993e96c6d9fbf6690e9da to your computer and use it in GitHub Desktop.
Easy Affiliate - Pay higher commission if user signed up AFTER affiliate
This file contains 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('esaf_commission_percentages', function ($commission, $affiliate, $transaction) { | |
if($transaction) { | |
$user = get_user_by('email', $transaction->cust_email); | |
if($user && strtotime($user->user_registered) > strtotime($affiliate->user_registered)) { | |
$commission = array(30); | |
} | |
} | |
return $commission; | |
}, 50, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment