nicklestud Posted October 23, 2007 Share Posted October 23, 2007 I seem to get an error when using the DHL Module. The error is as reads: DHL Express (1 x 2lbs) DHL Express The following errors have occured: 1. Country invalid. I get this whenever I use a UK address. Anyone else getting this error when they are using a certain address? -Nickle Quote Link to comment Share on other sites More sharing options...
nicklestud Posted November 29, 2007 Author Share Posted November 29, 2007 Here is what DHL sent me about this issue: Sorry for the incorrect code .Use "UK" instead of "GB". Here is an example : <Receiver> <Address> <CompanyName>Coke E. Coli</CompanyName> <Street>303 Regent Street</Street> <City>Leicester</City> <State></State> <PostalCode>LE45DP</PostalCode> <Country>UK</Country> </Address> <AttnTo>Sally Consumer</AttnTo> <PhoneNbr>206-255-2555</PhoneNbr> </Receiver> The document will be updated. Regards, Harish XML Implementation Team DHL 10001 N. 92nd Street Suite 100 Scottsdale, AZ 85258 USA fax: (480) 907-2220 [email protected] www.dhl.com Quote Link to comment Share on other sites More sharing options...
nicklestud Posted November 29, 2007 Author Share Posted November 29, 2007 I put the code shown below into the includes/modules/shipping/dhlairborne.php somewhere around line 273. Pretty simple fix. Basically I had to change the information from 'GB' into "UK'. I tested it out for address from Scotland all the way to N Ireland and it works. Here is the old code: function _setDestination($street_address, $city, $state, $postal, $country) { global $order; $postal = str_replace(' ', '', $postal); $state_query = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_name = '" . $state . "' and zone_country_id = '" . (int)$order->delivery['country']['id'] . "'"); $state_info = tep_db_fetch_array($state_query); $this->destination_street_address = $street_address; $this->destination_city = $city; $this->destination_state = $state_info['zone_code']; $this->destination_postal = substr($postal, 0, 5); $this->destination_country = $country; } Here is what I changed it to: function _setDestination($street_address, $city, $state, $postal, $country) { global $order; $postal = str_replace(' ', '', $postal); $state_query = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_name = '" . $state . "' and zone_country_id = '" . (int)$order->delivery['country']['id'] . "'"); $state_info = tep_db_fetch_array($state_query); $this->destination_street_address = $street_address; $this->destination_city = $city; $this->destination_state = $state_info['zone_code']; $this->destination_postal = substr($postal, 0, 5); if ($country == 'GB'){ $country = "UK"; } $this->destination_country = $country; } Quote Link to comment Share on other sites More sharing options...
MontyMan Posted February 21, 2008 Share Posted February 21, 2008 You can also just go into Countries (under Locations / Taxes) in your configuration screens and for the country United Kingdom just change the two-letter code from GB to UK. This is where the shipping modules get their data. But this changes it for the entire osCommerce system, not just the DHL shipping module. Quote Link to comment Share on other sites More sharing options...
MontyMan Posted February 21, 2008 Share Posted February 21, 2008 I just changed it back and reloaded: UPS requires the code be GB and DHL requires that it be set to UK! I guess your shipping module patch is the best method after all. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.