Correct discount calculation in WooCommerce. get_item_count() includes quantities so just count  instead. #375
Fixes #401
Merge pull request #402 from sumobi/issue/401

Fixes #401
Ensure the discount code processing for EDD runs before referral completion. #406
Use ->affiliate_id in discount code tracking to fix #406
Don't allow affiliate's rate types to take effect if they don't also have a rate. Closes #408