I recently had all kinds of problems installing the UPS XML Shipping Module on my osCommerce shopping cart. I (thought I) followed the setup instructions correctly but every time I actually tried to checkout a shopping cart the shipping checkout page would hang and then I would get a mySQL timeout error. This error made no sense because the mySQL database was mostly empty and the shipping query is not that intensive.

After much debugging and hair pulling I found the solution. Since the website is set up on a GoDaddy Shared Hosting plan, the curl call to the UPS XML api was failing. GoDaddy Shared Hosting uses a curl proxy and you must configure any CURL requests to go through that proxy.

Below is the solution, which I am sad to say I found at the very end of the readme.txt document included with the UPS XML package AFTER I figured it out the HARD WAY! DOH and DOH. I am embarrassed to say I stopped reading the instructions when I thought I got to the end but the last last step is how to make it work with GoDaddy Hosting. Hopefully this post will save someone similar frustrations by being able to quickly find the solution with a google search!

From the readme.txt file …

----------------------------

STEP 12 ** FOR GODADDY HOSTING ONLY **

----------------------------

A number of people using GoDaddy for their hosting have found that the UPSXML module times out when getting rate quotes. This is due to the fact that GoDaddy uses a special setup for the https connections, namely a proxy server.

In that case (haven't tested this, but this is a compilation from the postings and uploads) change a part of the code in catalog/includes/modules/shipping/upsxml.php

Line 662-670

**REPLACE**

// uncomment the next line if you get curl error 60: error setting certificate verify locations
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
// uncommenting the next line is most likely not necessary in case of error 60
// curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
curl_setopt($ch, CURLOPT_TIMEOUT, (int)$timeout);

**WITH**

// BOF GODADDY STUFF
// uncomment the next line if you get curl error 60: error setting certificate verify locations
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
// uncommenting the next line is most likely not necessary in case of error 60
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt ($ch, CURLOPT_PROXY, "http://proxy.shr.secureserver.net:3128");

// EOF GODADDY STUFF

Technorati Tags: , ,

del.icio.us:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting digg:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting spurl:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting wists:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting simpy:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting newsvine:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting blinklist:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting furl:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting reddit:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting fark:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting blogmarks:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting Y!:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting smarking:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting magnolia:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting segnalo:Setting Up osCommerce UPS XML Module w/ GoDaddy Shared Hosting