So I was going through the code trying to figure out the best way to add a feature I need - affiliate commission schedule based on memberships (or user roles they grant) rather than the override setting on a membership setting the affiliate schedule when that membership is bought...
And I stumbled onto a very convenient hook, hook_ms_affiliates_commission, implemented as $hook($commission, $level, $amount, $account) in ms_affiliates.module.
The thing is, in this context, it seems like $account is undefined... if the hook is intended to receive the account of the affiliate receiving the commission, the variable passed to $hook in that context should be $affiliate, the account of the affiliate, not $account (assumedly that would be the buyer's account if it were defined?)








Vector,
Yes, you are right, it should have been $affiliate. None of my modules use this hook so that's why it wasn't caught before. I'll include this fix in the next release.
Sincerely,
Leighton Whiting