***The problem: On the shopping cart page -- When an Item is on sale or featured; and a discount code is used that has a restriction; the shopping cart doesn't know how to handle it.
However when on the payment page order total is calculated pefectly
see screenshots starting with 001
***To note: The shopping cart has been modified to calculate discounts before free shipping.
In my shop I have it set for free shipping on orders greater than 50. I also have a 50% off code.
If someone makes a 60 order and uses the 50% off code their grand total is $30 and they still get free shipping. THEY SHOULD NOT GET FREE SHIPPING.
Your fix should retain this property.
***Contact me for any clarification