完整的设置订单追踪信息的时候我们可能会用到它,在后台中他在这里设置: 
有的时候我们想要设置自定义的 carrier 例如 顺丰 申通 圆通 。。等等 
我们可以先从 magento api 入手分析 
我们调用 magento api  —->   order_shipment.getCarriers 
可以去查找 api 函数 在 app\code\core\Mage\Sales\Model\Order\Shipment\Api.php
    public function getCarriers($orderIncrementId)
    {
        $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
        /**
          * Check order existing
          */
        if (!$order->getId()) {
            $this->_fault('order_not_exists');
        }
        return $this->_getCarriers($order);
    }
追踪 _getCarriers 方法
 protected function _getCarriers($object)
    {
        $carriers = array();
        $carrierInstances = Mage::getSingleton('shipping/config')->getAllCarriers(
            $object->getStoreId()
        );
        $carriers['custom'] = Mage::helper('sales')->__('Custom Value');
        foreach ($carrierInstances as $code => $carrier) {
            if ($carrier->isTrackingAvailable()) {
                $carriers[$code] = $carrier->getConfigData('title');
            }
        }
        return $carriers;
    }
即 都会有个默认的 custom  
之后的都是通过 Mage::getSingleton(‘shipping/config’)->getAllCarriers() 获取的 
追踪方法 getAllCarriers() 其实就是循环config中的 carriers 例如这里面就有magento 自带的freeshipping 
和 flatrate 等方法。 但是 要想显示到返回的 $carriers 中需要 isTrackingAvailable 为true 
我们其实可以在上面代码中打印你每一个 $carrier 的类名 找到调用的 isTrackingAvailable  方法, 
经分析 发现默认的例如 flatrate 他的 model中方法 isTrackingAvailable 是继承父类为false 的。 
那么如果此时你想在后台 carrier中有 flatrate 可以设置他的 isTrackingAvailable 方法返回true就行了 
同样适用于你自定义的运送方式。
扩展的说下: 
还有一点,我们在前台结账的时候到 选择运送方式的时候例如有 flatrate 那么此时他的input value 你可以看到是 
flatrate_flatrate 我们继续追踪代码,发现他在代码中显示的 是 getCarrier().’_’.getMethod() 通常我们会把这两个值在 
设置的时候设置为一样的(在flatrate的model中)所以显示的就是这个样子了
但是这里要说的就是对接 Odoo 的时候默认的magento连接件 是通过这个订单的shipping method ,即运送方式 
你可以在数据表 sale_flat_order 找到 例如就是 flatrate_flatrate  。 然而此时你在 Odoo 中设置tracking number的时候 
可能报错,是因为提示没有 flatrate_flatrate  
这时如果magento 设置 flatrate 的isTrackingAvailable 为true 你把Odoo中这个code改为 flatrate 就可以了 
如果没有,可以直接设置code 为 custom 也是可以的,因为你可以在magento api中找到 默认都有个为 custom的code
此文章通过 python 爬虫创建,原文是自己的csdn 地址: magento getCarriers 分析