, ,

Many times we offer customers to have free shipping based on some promotional rule. In that case, the other shipping methods are also shown up to the customer which may involve price for the shipping. If a customer is eligible for free shipping then showing the other shipping methods having price doesn’t sounds good. So, in order to remove those shipping methods if there’s a condition where customer can get the free shipping I’d written a custom module which I’m going to mention below.

  1. Firstly, create a magento module (I hope you know how to create a custom module in magento?).
  2. Create a block file which will extends to Mage_Checkout_Block_Onepage_Shipping_Method_Available
    class Faisal_Filtershipping_Block_Checkout_Onepage_Shipping_Method_Available
    Mage_Checkout_Block_Onepage_Shipping_Method_Available {
        public function getShippingRates() {
            $groups = parent::getShippingRates();
            $free = array();
            foreach ($groups as $code => $_rates) {
                foreach ($_rates as $_rate) {
                    if (!$_rate->getPrice() > 0) {
                        $free[$code] = $_rates;
            if (!empty($free)) {
                return $this->_rates = $free;
            return $groups;
  3. Override the Mage_Checkout_Block_Onepage_Shipping_Method_Available block in your config.xml

For more QA and experts advice you may see these two questions: