If a customer has two coupons for the same product, each restricted to one use and his email address and giving a fixed discount, if he adds one unit of that product his cart both coupons are applied. This still happens even if the first coupon is enough to reduce the balance to zero; the second coupon is still consumed and “wasted.”
A work around is to enable “Individual Use Only,” but then if the customer wants to order 2 units of the product, the second coupon won’t apply when we want it to, he has to make a second order.
How can we configure the second coupon to not apply if the balance has already reached zero and it is not required for that order?
WooCommerce exposes the value of a coupon added to a cart through WC_Cart::get_coupon_discount_totals(), couldn’t you just loop through each coupon added to the cart and remove coupons where the discount is 0?