Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cartpauj/5452b5b92c1993e96c6d9fbf6690e9da to your computer and use it in GitHub Desktop.
Save cartpauj/5452b5b92c1993e96c6d9fbf6690e9da to your computer and use it in GitHub Desktop.
Easy Affiliate - Pay higher commission if user signed up AFTER affiliate
<?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