bubbastien Posted September 3, 2011 Share Posted September 3, 2011 This error is returned when when the state or province code is longer than 2 characters ---- Error in processing transaction. ERROR crs 840 The length of the destination state or province exceeds the limit of 2 characters. The length of the destination state or province exceeds the limit of 2 characters. ---- Which is very annoying if you ship to Europe, as we do. If you actually go to your fedex rate quote web page you'll see that the state/province isn't even required for a rate quote to a European address. So, if you don't like the idea of going into oscommerce and changing all the zone codes to be 2 characters, this is the best hack I can come up with. The following hack seems to solve the problem without messing up shipping quotes to areas with 2 character state/province codes and maintains correct addresses for the invoices. This goes in --> /includes/modules/shipping/fedexwebservices.php, navigate down to around line 110 and find this block of code: // customer details $street_address = $order->delivery['street_address']; $street_address2 = $order->delivery['suburb']; $city = $order->delivery['city']; $state = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], ''); if ($state == "QC") $state = "PQ"; $postcode = str_replace(array(' ', '-'), '', $order->delivery['postcode']); $country_id = $order->delivery['country']['iso_code_2']; I inserted this comment and code after -> if ($state == "QC") $state = "PQ"; // Fix for long province codes $state = substr($state, 0, 2); But it would also work right at the end of the code block above, it just needs to be done somewhere after "if ($state == "QC").." and before "$request['RequestedShipment']['Recipient']..." is defined in the next code block. All this does is shorten the state/province code to be the first 2 characters of the code before the rate request is created, so SXE becomes SX and the rate request is processed without generating an error. So long as there is a post code and a street address I think it should function properly. I make no guarantees... Your mileage may vary Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.