Opencart:USPS 在结账时未显示国际服务
Opencart: USPS not showing International Services on checkout
opencart2.0.1.1
USPS 设置:-重量 Class= 磅,地理区域= 所有区域,尺寸(长 x 宽 x 高)=10x10x10,邮政编码=33446
产品:- 重量 Class = 磅,尺寸(长 x 宽 x 高)=10x10x10,重量 =4.
它在国内服务中工作正常但是当我使用其他国家(墨西哥)结账时国际服务没有显示,
我刚发现 $this->config->get('usps_girth')
没有返回任何值,
所以我用公式算出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);
opencart2.0.1.1
USPS 设置:-重量 Class= 磅,地理区域= 所有区域,尺寸(长 x 宽 x 高)=10x10x10,邮政编码=33446
产品:- 重量 Class = 磅,尺寸(长 x 宽 x 高)=10x10x10,重量 =4.
它在国内服务中工作正常但是当我使用其他国家(墨西哥)结账时国际服务没有显示,
我刚发现 $this->config->get('usps_girth')
没有返回任何值,
所以我用公式算出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);