Magento 1.7 Table Rates Shipping Method Always Includes Tax in Order Subtotal

table-rates

I'm having an issue with Magento Table Rates. Magento always adds a tax to the "Order Subtotal". I spend hours to get rid of it and to find the line where Magento is doing this. Unfortunately without success.

My CSV contains for example:

Country,Region/State,"Zip/Postal Code","Order Subtotal (and above)","Shipping Price"
*,*,*,0.0000,14.5000
*,*,*,35.0000,0.0000

That means that all orders >= $35 are eligible for free shipping. But only orders >= $42 gets the free shipping options. Its definitely the tax – if I'm going to the checkout page I see $7 tax.

It only works if I set "Order Subtotal" to "29.0000" instead of "35.0000". But that's a bad and only static solution.
Does anyone know how I can solve this?

Thank you so much in advance.

Best Answer

I finally found a solution. Copy file Mage/Shipping/Model/Carrier/Tablerate.php to your local directory and add following code before //Free shipping by qty (around line 78)

        if (Mage::helper('tax')->priceIncludesTax()) {
        $taxableAmount = 0;
        foreach ($request->getAllItems() as $item) {
            $taxableAmount += $item->getTaxableAmount();
        }
        $request->setPackageValue($taxableAmount);
    }

Please let me know if you have any concerns but it seems to work :)

Related Topic