Search code examples
opencart2.xusps

Opencart: USPS not showing International Services on checkout


opencart2.0.1.1

USPS setting:-Weight Class= Pound, Geo Zone= All Zones, Dimensions (L x W x H)=10x10x10, Zip Code=33446

product:- Weight Class = Pound, Dimensions (L x W x H)=10x10x10, Weight =4.

it is working properly in Domestic Services But International Services is not showing when i m checkout using other country(Mexico),


Solution

  • I just find out $this->config->get('usps_girth') not returning any value,

    So i use formula to find out girth = L + W * 2 + H * 2 ;

    In \catalog\model\shipping\usps.php i have changed at line 300 aprx.

    From 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);
    

    To 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);