1

Is there a setting I could use to disable all the other shipping methods when free delivery shipping method kicks in? I have set an amount for free delivery to kick in and it's just stupid to display standard delivery method when free is available.

I have checked the standard delivery table rates, but it goes by the weight and not order amount. I have also tried to specify price vs. destination. But that option is not working well for me since my delivery partner ships product by weight.

3 Answers 3

1

You may disable free shipping method in the setting AND enable it with shopping cart rule for some order amount.

Alternatively take a look at this answer How can I hide a shipping option if that option is available as flat-rate or free?

1

A resolve by extending class Mage_Model_Quote_Address. There is the getGroupedAllShippingRates function that fetches all available shipping rates. You may want to check if the original code I've used from getGroupedAllShippingRates matches what you have in your Magento version.

/**
 * Retrieve all grouped shipping rates
 *
 * @return array
 */
public function getGroupedAllShippingRates()
{
    $rates = array();

    /* added code */
    $found = false;
    $collection = $this->getShippingRatesCollection();
    foreach ($collection as $rate) {
        if (!$rate->isDeleted() && $rate->getCarrierInstance()) {
            if ($rate->getCarrier() == "freeshipping" /*&& $rate->getMethod() == "freeshipping"*/) {
                $found = true;
            }
        }

    }

    foreach ($collection as $rate) {
        if (!$rate->isDeleted() && $rate->getCarrierInstance()) {
            if (!isset($rates[$rate->getCarrier()])) {
                $rates[$rate->getCarrier()] = array();
            }

            /* added code */
            $storeId = $this->getQuote()->getStoreId();
            switch ($storeId) {
                case 1: // my store -> default store
                    // any order that is not free shipping -> ignore
                    if ($found && !($rate->getCarrier() == "freeshipping" /*&& $rate->getMethod() == "freeshipping"*/)) {
                        continue 2;
                    }
                    break;
            }

            $rates[$rate->getCarrier()][] = $rate;
            $rates[$rate->getCarrier()][0]->carrier_sort_order = $rate->getCarrierInstance()->getSortOrder();
        }
    }
    uasort($rates, array($this, '_sortRates'));
    return $rates;
}
0

You can do price vs destination, which would solve your problem, as you wouldn't need to enable "Free shipping" in shipping methods.

enter image description here

3
  • it's not a good solution for me. I want the shipment price to goes by weight since this price is synced with my logistics partner and they ship by weight. Jul 30, 2014 at 13:54
  • I'm sorry but at the time of reading your edit I had already answered.(time to change language, make screenshot etc etc ^^) Jul 30, 2014 at 13:59
  • have you tried Owebia Shipping? It's a pretty advanced solution for custom rates on shipping. Jul 30, 2014 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.