【问题标题】:Opencart: USPS not showing International Services on checkoutOpencart:USPS 在结账时未显示国际服务
【发布时间】:2015-03-24 09:40:35
【问题描述】:

opencart2.0.1.1

USPS 设置:-重量等级 = 磅,地理区域 = 所有区域,尺寸(长 x 宽 x 高)=10x10x10,邮政编码=33446

产品:- 重量等级 = 磅,尺寸(长 x 宽 x 高)=10x10x10,重量 =4。

它在国内服务中正常工作,但是当我使用其他国家/地区(墨西哥)结账时,国际服务没有显示,

【问题讨论】:

    标签: opencart2.x usps


    【解决方案1】:

    我刚刚发现$this->config->get('usps_girth')没有返回任何值,

    所以我用公式找出周长 = L + W * 2 + H * 2 ;

    在 \catalog\model\shipping\usps.php 中,我在第 300 行 aprx 进行了更改。

    来自 usps.php

    $xml .= '       <Container>' . $this->config->get('usps_container') . '</Container>';
    $xml .= '       <Size>' . $this->config->get('usps_size') . '</Size>';
    $xml .= '       <Width>' . $this->config->get('usps_width') . '</Width>';
    $xml .= '       <Length>' . $this->config->get('usps_length') . '</Length>';
    $xml .= '       <Height>' . $this->config->get('usps_height') . '</Height>';
    $xml .= '       <Girth>' . $this->config->get('usps_girth') . '</Girth>';
    $xml .= '       <CommercialFlag>N</CommercialFlag>';
    $xml .= '   </Package>';
    $xml .= '</IntlRateV2Request>';
    $request = 'API=IntlRateV2&XML=' . urlencode($xml);
    

    到 usps.php

    //$this->config->get('usps_girth') -> to -> girth = L + W * 2 + H * 2          
    $girth =($this->config->get('usps_width'))+(($this->config->get('usps_length'))*2)+(($this->config->get('usps_height'))*2);
    
    $xml .= '       <Container>' . $this->config->get('usps_container') . '</Container>';
    $xml .= '       <Size>' . $this->config->get('usps_size') . '</Size>';
    $xml .= '       <Width>' . $this->config->get('usps_width') . '</Width>';
    $xml .= '       <Length>' . $this->config->get('usps_length') . '</Length>';
    $xml .= '       <Height>' . $this->config->get('usps_height') . '</Height>';
    $xml .= '       <Girth>' . $girth . '</Girth>';
    $xml .= '       <CommercialFlag>N</CommercialFlag>';
    $xml .= '   </Package>';
    $xml .= '</IntlRateV2Request>';
    $request = 'API=IntlRateV2&XML=' . urlencode($xml);
    

    【讨论】:

      猜你喜欢
      • 2020-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-15
      • 1970-01-01
      • 2020-06-25
      • 1970-01-01
      相关资源
      最近更新 更多