Affiliate commissions are calculated based on the pre-tax/shipping Item Total after all discounts have been applied but minus the price of any items in the order which have a product-specific share percentage set (for which commission is calculated separately).
E.g., suppose an affiliate-referred buyer orders Products A, B and C with a $2-off coupon code while you have a 20% common affiliate share and a product-specific 10% share for Product C, which also has its own $1-off item-specific discount:
+$3.00 Item A
+$5.00 Item B
+$7.00 Item C ($8.00 reg. price - $1.00 item-specific discount)
============
=$15.00 Item SubTotal
- $2.00 Cart Discount
============
=$13.00 Item Total
+$1.00 Tax
+$2.00 Shipping
============
=$16.00 Order Total
The affiliate would earn $1.20 (@20%) for the combined total of Item A and B minus the cart discount, plus $0.70 (@10%) for Item C, making a total $1.90 commission earned.