【问题标题】:Shipments - editing custom value in dropdown box for carrier发货 - 在承运人的下拉框中编辑自定义值
【发布时间】:2009-11-24 12:37:53
【问题描述】:

好的,我的问题是我的客户希望他们的运输承运人“Colissimo”在 Magento 的管理员中创建运输文档时出现在承运人的下拉框中。下拉列表中的值之一是自定义值。有什么方法可以将其编辑为“Colissimo”吗?

【问题讨论】:

    标签: magento


    【解决方案1】:

    要修改的文件是app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create。在进行任何更改之前,您应该制作它的本地版本(app/code/local/Mage/Adminhtml/Block/Sales/Order/Shipment/Create),并在此本地副本中进行所有更改。

    在里面你会找到一个 getCarriers() 函数,你需要在里面插入运营商的名字。

    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;
    }
    

    【讨论】:

    • 在 1.8.x 中移至文件 Shipment/Create/Tracking.php
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-07
    相关资源
    最近更新 更多