[Mini Tutorial] – How to Solve the “Free Shipping Minimum Subtotal with Discount” Issue

In Magento, one can set a minimum order amount to offer Free Shipping. However, if a discount is applied to the order, Magento ignores the discount.

Imagine a cart subtotal of $10 and a grand total of $5 due to a 50% discount. If the minimum order amount for free shipping was set to $10, Magento will still offer the Free shipping.

How To Solve This Issue

To prevent this from happening, the solution for Magento Community Edition 1.7 is to override collectRates() in class Mage_Shipping_Model_Carrier_Freeshipping.

In this line:

if (($request->getFreeShipping()) || ($request->getBaseSubtotalInclTax() >= $this->getConfigData('free_shipping_subtotal'))

Replace getBaseSubtotalInclTax() with $request->getPackageValueWithDiscount()

Please Note

This solution will work under the following conditions:

1) Magento Community Edition 1.7 (solution for other versions should be similar)
2) Free Shipping is NOT applied by a Shopping Cart rule

Source: Magento Forum