Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento free shipping not working

Tags:

magento

I have enabled free-shipping from System->Configration->Shipping Methods, and I set the Minimum Order Amount to 50 but it doesn't work

Also I wonder why this condition if($request->getFreeShipping()) always return false

like image 830
Ahmed Hashem Avatar asked Dec 02 '22 22:12

Ahmed Hashem


1 Answers

I actually had this problem myself and stumbled on this question. For me it was because the cart subtotal was not being loaded properly in the Freeshipping.php file which is located in the below path.

Path to File:

/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php

Now, Copy this file:

/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php

to this file location

/app/code/local/Mage/Shipping/Model/Carrier/Freeshipping.php

Find the line that has this

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

And replace it with this

    $totals = Mage::getSingleton('checkout/cart')->getQuote()->getTotals();
    $subtotal = $totals["subtotal"]->getValue();

    if (($request->getFreeShipping())
        || ($subtotal >= $this->getConfigData('free_shipping_subtotal'))
like image 159
Calvin K Avatar answered Jan 03 '23 22:01

Calvin K