开发者

Shipments - editing custom value in dropdown box for carrier

OK my problem is that my client would like their shippi开发者_高级运维ng carrier 'Colissimo' to appear in the drop down box for Carrier when creating the Shipment document in Admin of magento. One of the values in the dropdown is Custom Value. Is there any way of editing this to 'Colissimo'?


The file to modify is app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create. You should make a local version of it (app/code/local/Mage/Adminhtml/Block/Sales/Order/Shipment/Create) before making any changes and do all the changes in this local copy.

Inside you will find a getCarriers() function, which is where you need to insert the name of the carrier.

public function getCarriers()
{
    $carriers = array();
    $carrierInstances = Mage::getSingleton('shipping/config')->getAllCarriers(
        $this->getShipment()->getStoreId()
    );
        //you can change 'Custom Value' to 'Colissimo' and that should be it.
    $carriers['custom'] = Mage::helper('sales')->__('Custom Value');
    foreach ($carrierInstances as $code => $carrier) {
        if ($carrier->isTrackingAvailable()) {
            $carriers[$code] = $carrier->getConfigData('title');
        }
    }
    return $carriers;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜