Fix Opencart Fedex Shipping Error

I’m using Opencart 1.5.6.4 and the default FedEx module doesn’t display any shipping options during checkout.

I changed code and get response message:

<Code>556</Code><Message>There are no valid services available. </Message>

After contact with FedEx technical support, i found the problem is caused by StateOrProvinceCode.
The script use Zone Name as value, but it need to use Zone Code.

For example, after we change ‘Ontario’ to ‘ON’, the FedEx shipping options can success list during checkout.

<ns1:Address>
  <ns1:StateOrProvinceCode>Ontario</ns1:StateOrProvinceCode> 
  <ns1:PostalCode>L3L1G1</ns1:PostalCode> 
  <ns1:CountryCode>CA</ns1:CountryCode>
</ns1:Address> 

All you need to do is open file ‘catalog/model/shipping/fedex.php’.

Search

if ($country_info['iso_code_2'] == 'US')

change it to

if ($country_info['iso_code_2'] == 'US' || $country_info['iso_code_2'] == 'CA')

There are total 2 lines need these change, one for Shipper and another for Recipient.

That’s all!

affiliate_link
Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

One Response to “Fix Opencart Fedex Shipping Error”

Trackbacks are disabled.

  • Ashfaq says:

    HI,
    I am using opencart 2.0.3.1,and i am also using fedex shipping module, when i go for checkout my fedex module produces error for US, and UK.
    Can you please help me. your kind help will be appreciated.
    Thanks
    Best Regards
    Ashfaq