dongyun6835 2016-06-30 18:11
浏览 59

在opencart中添加UPS服务

Hello

Opencart Version: 2.0.1.1

I am trying to add a new service under ups on opencart. Like UPS ground, there is a service ups surepost. I have made sure that surepost was enabled on my account. Just that i cannot pull rates on opencart frontend.

below is my vqmod i created to add the service. Please let me know how can i fix this issue.

<modification>
    <id>Add SurePost</id>
    <version>OC 2.0.1.1</version>
    <vqmver>2.5.x</vqmver>
    <author>SurePost</author>
    <file name="/admin/controller/shipping/ups.php">
        <operation>
            <search position="after"><![CDATA[$data['text_today_express_saver'] = $this->language->get('text_today_express_saver');]]></search>
            <add><![CDATA[
            $data['text_surepost_1lb_greater'] = $this->language->get('text_surepost_1lb_greater');
            $data['text_surepost_less_than_1lb'] = $this->language->get('text_surepost_less_than_1lb');
            ]]></add>
        </operation>
        <operation>
            <search position="before"><![CDATA[if (isset($this->request->post['ups_us_65'])) {]]></search>
            <add><![CDATA[
            if (isset($this->request->post['ups_us_93'])) {
            $data['ups_us_93'] = $this->request->post['ups_us_93'];
            } else if (isset($this->request->post['ups_us_92'])) {
                $data['ups_us_92'] = $this->config->get('ups_us_92');
            }
            ]]></add>
        </operation>
    </file>

    <file name="/admin/language/english/shipping/ups.php">
        <operation>
            <search position="after"><![CDATA[$_['text_today_express_saver']     = 'UPS Today Express Saver';]]></search>
            <add><![CDATA[$_[
            'text_surepost_1lb_greater']     = 'UPS Surepost 1lb or Greater';
            $_['text_surepost_less_than_1lb']     = 'UPS Surepost Less Than 1lb';
            ]]></add>
        </operation>

    </file>

    <file name="/admin/view/template/shipping/ups.tpl">
        <operation>
            <search position="after"><![CDATA[
                <div id="US">
            ]]></search>
            <add><![CDATA[
                <!--SUREPOST -->
                  <div class="checkbox">
                    <label>
                      <?php if ($ups_us_93) { ?>
                      <input type="checkbox" name="ups_us_93" value="1" checked="checked" />
                      <?php echo $text_surepost_1lb_greater; ?>
                      <?php } else if ($ups_us_92) { ?>
                      <input type="checkbox" name="ups_us_92" value="1" />
                      <?php echo $text_surepost_less_than_1lb; ?>
                      <?php } ?>
                    </label>
                  </div>

                  <!-- SUREPOST -->
            ]]></add>
        </operation>

    </file>
<file name="/catalog/language/english/shipping/ups.php">
        <operation>
            <search position="after"><![CDATA[$_['text_us_origin_65']    = 'UPS Saver';]]></search>
            <add><![CDATA[
                        $_['text_us_origin_92'] = 'Economy Shipping Under 1lb';
                        $_['text_us_origin_93'] = 'Economy Shipping Over 1lb';
                        ]]></add>
        </operation>

    </file>
<file name="/catalog/model/shipping/ups.php">
        <operation>
            <search position="replace"><![CDATA['65' => $this->language->get('text_us_origin_65')]]></search>
            <add><![CDATA[  '65' => $this->language->get('text_us_origin_65'),
                            '92' => $this->language->get('text_us_origin_92'),
                            '93' => $this->language->get('text_us_origin_93')
                        ]]></add>
        </operation>

    </file>
</modification>

Thank you.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条
    • ¥15 Python报错怎么解决
    • ¥15 simulink如何调用DLL文件
    • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
    • ¥30 线性代数的问题,我真的忘了线代的知识了
    • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
    • ¥188 需要修改一个工具,懂得汇编的人来。
    • ¥15 livecharts wpf piechart 属性
    • ¥20 数学建模,尽量用matlab回答,论文格式
    • ¥15 昨天挂载了一下u盘,然后拔了