您好
Opencart Version: 2.0.1.1
我正在尝试在opencart上添加新服务。像UPS地面,有一个服务ups surepost。我确保在我的帐户上启用了surepost。只是我不能在开放式前端拉动费率。
下面是我创建的vqmod以添加服务。请让我知道如何解决这个问题。
<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>
<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>
谢谢。