...
- ridiculously complex commission calculation code (we need to recalculate commissions for each past order in current affiliate plan period on every new approved order)
- affiliate gets commissions from orders, that were first approved, but then declined
Affiliate association
Right now if user is affiliate himself and he makes a purchase, then he earns commissions from his own purchase, which doesn't really make sense.
Solution
To solve above issues I propose to :
- To move commission calculation code from "order approval method" to "affiliate statistics reset method"
- Don't consider affiliate user login reason to create affiliate association. In fact if one affiliate makes purchase using another affiliate code, then another affiliate (code owner) should get credit for that.
Pros:
- administrator/affiliate don't see any intermediate commissions that might be different once affiliate plan period is over
- actual commission % (from affiliate plan) is determined once per period, which reduces error factor greatly
...