Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New UPS XML Shipping Module available


Recommended Posts

is there a way to turn off the time in transit function in the new V1.1.3?
Sure, just comment out the call for the code (see below). The code will handle the lack of time in transit info without problem.

 

// BOF Time In Transit
// if you choose to use the time in transit API, remove the comment tags below (/* and */)
// there is also another section near the end of this file that will need to have the tags removed

/*        $this->servicesTimeintransit = $this->_upsGetTimeServices();
       if ($this->logfile) {
           error_log("------------------------------------------\n", 3, $this->logfile);
           error_log("Time in Transit: " . $this->timeintransit . "\n", 3, $this->logfile);
       }
*/
// EOF Time In Transit

Link to comment
Share on other sites

Just wanted to thank Stuart, Jan and Donna for making this wonderful contribution work!

 

With your help I've managed to get the whole contrib installed (dimensions, time in transit etc) and all of it works from a Canadian store.

 

Way to go people - and thanks! :thumbsup:

Best & Thanks;
Marvin
----------------------
osCommerce 2.3.3.4 

Link to comment
Share on other sites

Hi all!

I still have got some problems with this contribution. I have got Linux Mandrake 10.0 and I've just installed the latest release of this contribution. I created a user and did some shopping (2 items).

After I clicked "Check out" I got only a blank white page. (.../checkout_shipping.php?osCsid=3bbeb81bd6aae10f89dbe73ae5215447)

I tought that the problem could be the incorrect CURL installation and I tried the next example:

 

<?php

$url = "http://www.amazon.com/exec/obidos/search-handle-form/002-5640957-2809605";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_FAILONERROR, 1);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_TIMEOUT, 3);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, "url=index%3Dbooks&field-keywords=PHP+MYSQL");

$result = curl_exec($ch);

curl_close($ch);

echo $result;

?>

 

It works good. Did I miss anything? I have no idea what is the problem.

I set all my service options and I have a valid account with UPS.

I have got the UPS Rates account access key too.

Any ideas?

G.

 

:'(

Link to comment
Share on other sites

torin, Great module, thanks. I have it installed on a recent snapshot. All install went well.  We set it up as follows:

When selecting some shipping methods from UPS, rather than accepting the rate and moving on with the checkout, the rates all double and the screen to select a ship method is shown again. This appears to happen with 2 day, 3day and overnight, but ground seem to work fine.

Other rates work fine.

Thanks

frankj

 

I have added a quick fix for this bug of the shipping rate doubling in the order total:

Read more details here:

http://www.oscommerce.com/forums/index.php?showtopic=61881

Link to comment
Share on other sites

Hi all!

 

I still have got some problems with this contribution. I have got Linux Mandrake 10.0 and I've just installed the latest release of this contribution. I created a user and did some shopping (2 items).

After I clicked "Check out" I got only a blank white page. (.../checkout_shipping.php?osCsid=3bbeb81bd6aae10f89dbe73ae5215447)

I tought that the problem could be the incorrect CURL installation and I tried the next example:

 

<?php

$url = "http://www.amazon.com/exec/obidos/search-handle-form/002-5640957-2809605";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_FAILONERROR, 1);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_TIMEOUT, 3);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, "url=index%3Dbooks&field-keywords=PHP+MYSQL");

$result = curl_exec($ch);

curl_close($ch);

echo $result;

?>

 

It works good. Did I miss anything? I have no idea what is the problem.

I set all my service options and I have a valid account with UPS.

I have got the UPS Rates account access key too.

 

Any ideas?

G.

 

 

I tried to use capitals but no change. I even installed another version of Linux but ... no change.

I even used the unchanged osCommerce from download and the recent version of UPS XML Rates and Services v1.1.3a I got only a blank white page!

(http://localhost/catalog/checkout_shipping.php?osCsid=bded74bf31942e735b2a28c00804d22c)

 

I checked the log file (see bellow) it maks no sense for me.

Is Canada supported in this contribution? :blink:

G.

 

 

**********************

* Configuration *

**********************

 

United Parcel Service (XML)

 

Enable UPS Shipping

True

 

UPS Rates Access Key

*************************

 

UPS Rates Username

*********************

 

UPS Rates Password

*********************

 

Pickup Method

Daily Pickup

 

Packaging Type

Customer Package

 

Customer Classification Code

01

 

Shipping Origin

Canada Origin

 

Origin City

Calgary

 

Origin State/Province

AB

 

Origin Country

CA

 

Origin Zip/Postal Code

T2E8M5

 

Test or Production Mode

Production

 

Unit Weight

LBS

 

Unit Length

IN

 

Quote Type

Commercial

 

Handling Fee

0

 

Tax Class

--none--

 

Shipping Zone

--none--

 

Sort order of display.

0

 

Shipping Methods

Next Day Air, 2nd Day Air, Ground, Worldwide Express, Standard, 3 Day Select

 

Shipping Delay

1

 

 

 

 

**************

* Logfile *

**************

 

13/12/2004 15:30:53 [0.039s] /catalog/admin/configuration.php?gID=10&cID=118

13/12/2004 15:31:15 [0.039s] /catalog/admin/configuration.php?gID=10&cID=118&action=edit

13/12/2004 15:31:16 [0.106s] /catalog/admin/configuration.php?gID=10&cID=118

13/12/2004 15:31:20 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.149s)

13/12/2004 15:31:21 - /catalog/product_info.php?products_id=3&osCsid=bded74bf31942e735b2a28c00804d22c (0.164s)

13/12/2004 15:31:24 - /catalog/product_info.php?products_id=3&osCsid=bded74bf31942e735b2a28c00804d22c (0.110s)

13/12/2004 15:31:26 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.147s)

13/12/2004 15:32:32 [0.141s] /catalog/admin/modules.php?set=payment&selected_box=modules

13/12/2004 15:32:32 [0.125s] /catalog/admin/modules.php?set=payment&selected_box=modules

13/12/2004 15:32:35 [0.065s] /catalog/admin/modules.php?set=shipping

13/12/2004 15:32:38 [0.088s] /catalog/admin/modules.php?set=shipping&module=upsxml

13/12/2004 15:32:38 [0.196s] /catalog/admin/modules.php?set=shipping&module=upsxml

13/12/2004 15:32:39 [0.159s] /catalog/admin/modules.php?set=shipping&module=upsxml&action=edit

13/12/2004 15:32:48 [0.043s] /catalog/admin/modules.php?set=shipping&module=upsxml&action=save

13/12/2004 15:32:48 [0.161s] /catalog/admin/modules.php?set=shipping&module=upsxml

13/12/2004 15:32:54 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.237s)

13/12/2004 15:32:55 - /catalog/product_info.php?products_id=3&osCsid=bded74bf31942e735b2a28c00804d22c (0.112s)

13/12/2004 15:32:57 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.139s)

13/12/2004 15:32:58 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.101s)

13/12/2004 15:32:59 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.113s)

13/12/2004 15:33:00 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.096s)

13/12/2004 15:33:00 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.244s)

13/12/2004 15:35:11 [0.118s] /catalog/admin/modules.php?set=shipping&module=upsxml&action=edit

13/12/2004 15:35:39 [0.045s] /catalog/admin/modules.php?set=shipping&module=upsxml&action=save

13/12/2004 15:35:39 [0.239s] /catalog/admin/modules.php?set=shipping&module=upsxml

13/12/2004 15:35:48 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.234s)

13/12/2004 15:35:50 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.150s)

13/12/2004 15:35:51 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.214s)

13/12/2004 15:36:18 [0.094s] /catalog/admin/modules.php?set=shipping&module=upsxml&action=edit

13/12/2004 15:36:26 [0.086s] /catalog/admin/modules.php?set=shipping&module=upsxml&action=save

13/12/2004 15:36:26 [0.148s] /catalog/admin/modules.php?set=shipping&module=upsxml

13/12/2004 15:36:37 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.127s)

13/12/2004 15:36:40 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.143s)

13/12/2004 15:36:46 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.105s)

13/12/2004 15:37:12 [0.149s] /catalog/admin/modules.php?set=shipping&module=upsxml&action=edit

13/12/2004 15:37:24 [0.044s] /catalog/admin/modules.php?set=shipping&module=upsxml&action=save

13/12/2004 15:37:24 [0.113s] /catalog/admin/modules.php?set=shipping&module=upsxml

13/12/2004 15:37:30 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.126s)

13/12/2004 15:37:30 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.310s)

13/12/2004 15:37:31 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.170s)

13/12/2004 15:37:31 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.271s)

13/12/2004 15:41:11 [0.145s] /catalog/admin/modules.php?set=shipping&module=upsxml&action=edit

13/12/2004 15:41:23 [0.079s] /catalog/admin/categories.php?selected_box=catalog

13/12/2004 15:41:23 [0.112s] /catalog/admin/categories.php?selected_box=catalog

13/12/2004 15:41:24 [0.045s] /catalog/admin/configuration.php?gID=1&selected_box=configuration

13/12/2004 15:41:25 [0.042s] /catalog/admin/configuration.php?gID=1&selected_box=configuration

13/12/2004 15:41:29 [0.040s] /catalog/admin/configuration.php?gID=7

13/12/2004 15:41:31 [0.082s] /catalog/admin/configuration.php?gID=7&cID=98&action=edit

13/12/2004 15:41:33 [0.040s] /catalog/admin/configuration.php?gID=7&cID=98

13/12/2004 15:41:35 [0.041s] /catalog/admin/configuration.php?gID=7&cID=99

13/12/2004 15:41:35 [0.044s] /catalog/admin/configuration.php?gID=7&cID=99

13/12/2004 15:41:36 [0.071s] /catalog/admin/configuration.php?gID=7&cID=99&action=edit

13/12/2004 15:41:43 [0.059s] /catalog/admin/configuration.php?gID=7&cID=99&action=save

13/12/2004 15:41:43 [0.067s] /catalog/admin/configuration.php?gID=7&cID=99

13/12/2004 15:41:50 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.157s)

13/12/2004 15:41:52 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.236s)

13/12/2004 15:41:52 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.119s)

13/12/2004 15:41:53 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.283s)

13/12/2004 15:41:53 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.338s)

13/12/2004 15:46:04 - /catalog/shopping_cart.php?osCsid=bded74bf31942e735b2a28c00804d22c (0.136s)

13/12/2004 15:46:23 [0.070s] /catalog/admin/modules.php?selected_box=modules&set=payment

13/12/2004 15:46:25 [0.065s] /catalog/admin/modules.php?set=shipping

13/12/2004 15:46:28 [0.173s] /catalog/admin/modules.php?set=shipping

13/12/2004 15:46:30 [0.193s] /catalog/admin/modules.php?set=shipping&module=upsxml

13/12/2004 15:46:31 [0.137s] /catalog/admin/modules.php?set=shipping&module=upsxml&action=edit

13/12/2004 15:47:29 [0.214s] /catalog/admin/modules.php?set=shipping&module=upsxml

Link to comment
Share on other sites

Logging: did you try logging of the UPS XML transactions: around line 68 there is:

// to enable logging, create an empty "upsxml.log" file at the location you set below, give it write permissions (777) and uncomment the next line
//      $this->logfile = '/tmp/upsxml.log';

I would use a full path to the upsxml.log file, but maybe this works too. That would give you an indication what the module is sending to UPS (if any) and what the response of the UPS server is. Since you only get a white page I get the feeling something else is going terribly wrong that might have nothing to do with the UPS XML module (somebody else had a similar problem recently, I believe he posted in the shipping forum)...

Link to comment
Share on other sites

CRAP!! Scratch that... my host sent me an email at the same time saying they fixed it. Some settings were wrong on the server. So I tried the other 2 carts I didnt modify yet and those work fine now too so umm ya. That might be a fix for others though. Thank you sooo much again!!

 

I have the same problem. You know what they change on server?

Link to comment
Share on other sites

Hi,

 

I've been debugging issues with my install of UPSXML and followed the many helpful posts in this topic to try and resolve the "Rating and Service 1.0001 0 An unknown error...".

 

I've narrowed it down to a cURL issue. I can see the error in the logfile (thanks to someone's posting on how to track cURL issues):

 

"SSL: couldn't create a context!"

 

My client's web host provides the following when i run phpinfo():

 

CURL support enabled

CURL Information libcurl 7.8 (OpenSSL 0.9.6b) (ipv6 enabled)

 

can anyone point me in the right direction to resolve this ? (apart from moving my client's hosting, that is)

 

Thanks

Link to comment
Share on other sites

With a quick search on Google I found some info on that error, but with very little options for solving it:

 

http://curl.haxx.se/mail/archive-2003-10/0025.html

http://bugs.php.net/bug.php?id=12211&edit=1

 

The reason someone gave is: "The error message "SSL: couldn't create a context!" is a server error meaning that the OpenSSL function SSL_CTX_new() failed. libcurl can't perform anything

SSL-related then, and returns an error back. "

 

A solution that was given on the bugs.php.net page above is: "Compile PHP without OpenSSL support and CURL https:// calls should work just fine. Seems like there's some unsolved conflicts between OpenSSL and CURL/SSL support."

 

I don't think your hosting company will be enthousiastic about that solution....

Link to comment
Share on other sites

Hi all!

 

I still have got some problems with this contribution. I have got Linux Mandrake 10.0 and I've just installed the latest release of this contribution. I created a user and did some shopping.

After I clicked "Check out" I got only a blank white page. (.../checkout_shipping.php?osCsid=3bbeb81bd6aae10f89dbe73ae5215447)

 

I checked the UPS shipping log file it maks no sense for me.

Any idea?

G.

 

 

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

UPS URL: https://wwwcie.ups.com:443/ups.app/xml/TimeInTransit

UPS REQUEST: <?xml version="1.0"?>

<AccessRequest xml:lang="en-US">

<AccessLicenseNumber>**************</AccessLicenseNumber>

<UserId>**********</UserId>

<Password>***********</Password>

</AccessRequest>

<?xml version="1.0"?>

<TimeInTransitRequest xml:lang="en-US">

<Request>

<TransactionReference>

<CustomerContext>Time in Transit</CustomerContext>

<XpciVersion>1.0001</XpciVersion>

</TransactionReference>

<RequestAction>TimeInTransit</RequestAction>

</Request>

<TransitFrom>

<AddressArtifactFormat>

<PoliticalDivision2>Calgary</PoliticalDivision2>

<PoliticalDivision1>AB</PoliticalDivision1>

<CountryCode>CA</CountryCode>

<PostcodePrimaryLow>T2E8M5</PostcodePrimaryLow>

</AddressArtifactFormat>

</TransitFrom>

<TransitTo>

<AddressArtifactFormat>

<PoliticalDivision2>Calgary</PoliticalDivision2>

<PoliticalDivision1>AB</PoliticalDivision1>

<CountryCode>CA</CountryCode>

<PostcodePrimaryLow>t2k1t1</PostcodePrimaryLow>

<PostcodePrimaryHigh>t2k1t1</PostcodePrimaryHigh>

</AddressArtifactFormat>

</TransitTo>

<PickupDate>20041216</PickupDate>

<ShipmentWeight>

<UnitOfMeasurement>

<Code>KGS</Code>

</UnitOfMeasurement>

<Weight>10</Weight>

</ShipmentWeight>

<InvoiceLineTotal>

<CurrencyCode>USD</CurrencyCode>

<MonetaryValue>100</MonetaryValue>

</InvoiceLineTotal>

</TimeInTransitRequest>

 

UPS RESPONSE: <?xml version="1.0"?><TimeInTransitResponse><Response><TransactionReference><CustomerContext>Time in Transit</CustomerContext><XpciVersion>1.0001</XpciVersion></TransactionReference><ResponseStatusCode>1</ResponseStatusCode><ResponseStatusDescription>Success</ResponseStatusDescription></Response><TransitResponse><PickupDate>2004-12-16</PickupDate><TransitFrom><AddressArtifactFormat><PoliticalDivision2>CALGARY</PoliticalDivision2><PoliticalDivision1>AB</PoliticalDivision1><Country>CANADA</Country><CountryCode>CA</CountryCode><PostcodePrimaryLow>T2E8M5</PostcodePrimaryLow></AddressArtifactFormat></TransitFrom><TransitTo><AddressArtifactFormat><PoliticalDivision2>CALGARY</PoliticalDivision2><PoliticalDivision1>AB</PoliticalDivision1><Country>CANADA</Country><CountryCode>CA</CountryCode><PostcodePrimaryLow>T2K1T1</PostcodePrimaryLow></AddressArtifactFormat></TransitTo><AutoDutyCode>02</AutoDutyCode><ShipmentWeight><UnitOfMeasurement><Code>KGS</Code></UnitOfMeasurement><Weight>10.0</Weight></ShipmentWeight><InvoiceLineTotal><CurrencyCode>USD</CurrencyCode><MonetaryValue>100.00</MonetaryValue></InvoiceLineTotal><Disclaimer>All services are guaranteed if shipment is paid for in full by a payee in Canada. Services listed as guaranteed are backed by a money-back guarantee for transportation charges only. See Terms and Conditions in the Service Guide for details. Certain commodities and high value shipments may require additional transit time for customs clearance.</Disclaimer><ServiceSummary><Service><Code>23</Code><Description>UPS Express Plus</Description></Service><Guaranteed><Code>Y</Code></Guaranteed><EstimatedArrival><BusinessTransitDays>1</BusinessTransitDays><Time>08:00:00</Time><PickupDate>2004-12-16</PickupDate><PickupTime>17:00:00</PickupTime><HolidayCount>0</HolidayCount><DelayCount>0</DelayCount><Date>2004-12-17</Date><DayOfWeek>FRI</DayOfWeek><TotalTransitDays>1</TotalTransitDays><CustomerCenterCutoff>16:00:00</CustomerCenterCutoff><RestDays>0</RestDays></EstimatedArrival></ServiceSummary><ServiceSummary><Service><Code>24</Code><Description>UPS Express</Description></Service><Guaranteed><Code>Y</Code></Guaranteed><EstimatedArrival><BusinessTransitDays>1</BusinessTransitDays><Time>10:30:00</Time><PickupDate>2004-12-16</PickupDate><PickupTime>17:00:00</PickupTime><HolidayCount>0</HolidayCount><DelayCount>0</DelayCount><Date>2004-12-17</Date><DayOfWeek>FRI</DayOfWeek><TotalTransitDays>1</TotalTransitDays><CustomerCenterCutoff>16:00:00</CustomerCenterCutoff><RestDays>0</RestDays></EstimatedArrival></ServiceSummary><ServiceSummary><Service><Code>20</Code><Description>UPS Express Saver</Description></Service><Guaranteed><Code>Y</Code></Guaranteed><EstimatedArrival><BusinessTransitDays>1</BusinessTransitDays><Time>12:00:00</Time><PickupDate>2004-12-16</PickupDate><PickupTime>17:00:00</PickupTime><HolidayCount>0</HolidayCount><DelayCount>0</DelayCount><Date>2004-12-17</Date><DayOfWeek>FRI</DayOfWeek><TotalTransitDays>1</TotalTransitDays><CustomerCenterCutoff>16:00:00</CustomerCenterCutoff><RestDays>0</RestDays></EstimatedArrival></ServiceSummary><ServiceSummary><Service><Code>19</Code><Description>UPS Expedited</Description></Service><Guaranteed><Code>Y</Code></Guaranteed><EstimatedArrival><BusinessTransitDays>1</BusinessTransitDays><Time>23:30:00</Time><PickupDate>2004-12-16</PickupDate><PickupTime>17:00:00</PickupTime><HolidayCount>0</HolidayCount><DelayCount>0</DelayCount><Date>2004-12-17</Date><DayOfWeek>FRI</DayOfWeek><TotalTransitDays>1</TotalTransitDays><CustomerCenterCutoff>16:00:00</CustomerCenterCutoff><RestDays>0</RestDays></EstimatedArrival></ServiceSummary><ServiceSummary><Service><Code>25</Code><Description>UPS Standard</Description></Service><Guaranteed><Code>Y</Code></Guaranteed><EstimatedArrival><BusinessTransitDays>1</BusinessTransitDays><Time>23:30:00</Time><PickupDate>2004-12-16</PickupDate><PickupTime>17:00:00</PickupTime><HolidayCount>0</HolidayCount><DelayCount>0</DelayCount><Date>2004-12-17</Date><DayOfWeek>FRI</DayOfWeek><TotalTransitDays>1</TotalTransitDays><CustomerCenterCutoff>16:00:00</CustomerCenterCutoff><RestDays>0</RestDays></EstimatedArrival></ServiceSummary><MaximumListSize>35</MaximumListSize></TransitResponse></TimeInTransitResponse>

Link to comment
Share on other sites

I checked the UPS shipping log file it maks no sense for me.
That is a perfectly normal response from the UPS server.
Do I have to install any other package for XML???
No, the XML is handled by the file xmldocument.php that should have been put in includes/classes/. The same file is present in the admin section. You wil have it at the correct place because it is "required" in the upsxml.php:

require ('includes/classes/xmldocument.php');

It means that the problem is likely not with the UPSXML module but somewhere else. Not that that helps you of course...

Link to comment
Share on other sites

PHP cURL for sure, but if you didn't have that installed you would never have had a response from the UPS server, so that is not the problem. You don't need an other XML parser than the pair of xmldocument.php. From the readme.txt:

I tried like hell to use existing XML DOC support, but XML was not installed nor supported by my web hosting service which

required me to create my own. Hence, the additional pair of xmldocument.php files (they're identical) which provides simple

xml by path functions that work quite well for the task at hand.  You might find them useful elsewhere.

Link to comment
Share on other sites

Hi,

 

I am setting up UPS xml contrib v1.1.3a but not successful. I gave a BLANK page on checkout_shipping.php. I've follow the exact steps in readme.txt and updated the database as well, but still no help. When I disable the UPS xml module in Admin > Module > Shipping, the error gone and everything runs smoothly.

 

My server is based on below:

Windows 2003 standard

MySQL 4.0 + PHP 4.3.9

 

and my UPS XML config was:

 

United Parcel Service (XML)

 

Enable UPS Shipping

True

 

UPS Rates Access Key

UPS XML Access Key

 

UPS Rates Username

UPS online username

 

UPS Rates Password

UPS online password

 

Pickup Method

Daily Pickup

 

Packaging Type

Customer Package

 

Customer Classification Code

01

 

Shipping Origin

All other origins

 

Origin City

Seri Kembangan

 

Origin State/Province

SL

 

Origin Country

MY

 

Origin Zip/Postal Code

43300

 

Test or Production Mode

Test

 

Unit Weight

LBS

 

Unit Length

IN

 

Quote Type

Commercial

 

Handling Fee

0

 

Tax Class

--none--

 

Shipping Zone

--none--

 

Sort order of display.

0

 

Shipping Methods

Next Day Air, 2nd Day Air, Ground, Worldwide Express, Standard, 3 Day Select

 

Shipping Delay

1

 

 

Kindly help me. Very much appreciated!!

 

REgards

Steve

Edited by shukei98
Link to comment
Share on other sites

Steve,

 

Can you enable logging (see the top part of the upsxml.php file) and change something to log also cURL errors (see post #100 in this thread on page 6):

 

// next two lines added to make it work on production server   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

  if ($this->logfile) {
//    error_log("UPS REQUEST: " . $xmlRequest . "\n", 3, $this->logfile);
error_log("Error Message: " . curl_error($ch) . "\nUPS RESPONSE: " . $xmlResponse . "\n", 3, $this->logfile);
  }

Perhaps that will give some info to work with.

Link to comment
Share on other sites

Steve, Gabor,

 

Can you also add something to checkout_shipping.php to see if the UPS XML returned anything to give checkout_shipping something to work with?

 

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<?php 
           print ("<pre>\$quotes is: ");
           print_r($quotes[0]['methods']);
// use exit at first, can also be commented out later to keep a tab on quotes while
// the page is outputted below it.
           exit;
         
?>
<!-- header //-->

 

You should see something like:

$quotes is: Array
(
   [0] => Array
       (
           [id] => UPS Worldwide Express
           [title] => UPS Worldwide Express, 2004-12-22
           [cost] => 61.02
       )

)

Link to comment
Share on other sites

Hi Steve!

 

I have this configuration (see bellow). Do not forget to install the XML parser php-xml (see my previoue reply).

G.

 

United Parcel Service (XML)

 

Enable UPS Shipping

True

 

UPS Rates Access Key

**************************

 

UPS Rates Username

**************************

 

UPS Rates Password

**************************

 

Pickup Method

Daily Pickup

 

Packaging Type

Customer Package

 

Customer Classification Code

03

 

Shipping Origin

Canada Origin

 

Origin City

Calgary

 

Origin State/Province

AB

 

Origin Country

CA

 

Origin Zip/Postal Code

T2E8M5

 

Test or Production Mode

Test

 

Unit Weight

KGS

 

Unit Length

CM

 

Quote Type

Commercial

 

Handling Fee

0

 

Tax Class

--none--

 

Shipping Zone

--none--

 

Sort order of display.

0

 

Shipping Methods

Next Day Air, 2nd Day Air, Ground, Worldwide Express, Worldwide Expedited, Standard, 3 Day Select, Next Day Air Saver, Next Day Air Early A.M., Worldwide Express Plus, 2nd Day Air A.M., Express NA1, Express Saver

 

Shipping Delay

1

Link to comment
Share on other sites

I did some extensive tests of this module (1.1.3a) and I realized there are shipping cost differences (at least for shipping from Calgary.

 

I did these 8 cities: Calgary,Toronto,Vancouver,Quebec City,New York,Brownsville,San Diego,Miami

and 1kg, 5kg, 10kg, 20kg packages. I used the shipping cost calculator as the UPS reference values from here: http://wwwapps.ups.com/calTimeCost?loc=en_CA and the source was Calgary AB, T2E 8M5, Canada. The cost and declared value was $100 CAD per 1kg (...$2000 for 20kg package) and the currency was CAD. The module configuration (see the my reply above) The result is the next:

 

UPS Standard US & Canada:

For 1kg the price difference is < $1

For 5kg the price difference is > $2.5 < $4 (more then $2.5 but less then $4)

For 10kg the price difference is > $6 < $7 (more then $6 but less then $7)

For 20kg the price difference is > $12.5 < $14.5 (more then $12.5 but less then $14.5)

 

UPS Express US:

For 1kg the price difference is > $9.5 < $10 (more then $9.5 but less then $10)

For 5kg the price difference is > $8.3 < $9.5 (more then $8.3 but less then $9.5)

For 10kg the price difference is about $9.18

For 20kg the price difference is about $15.23

 

UPS Express Saver Canada:

For 1kg the price difference is < $2.20

For 5kg the price difference is > $2.4 < $5 (more then $2.4 but less then $5)

For 10kg the price difference is > $6 < $8.3 (more then $6 but less then $8.3)

For 20kg the price difference is > $12.5 < $15 (more then $12.5 but less then $15)

 

I was thinking to put a correction function into the code, but I do not know OOP PHP :(

I am very grateful for this contribution and I hope that this test result will help to improve it.

Gabor

Link to comment
Share on other sites

I have tried a couple of things to get UPSXML to work on a Linux (Suse) test server and found a couple of things others might want to try if they have trouble with the UPS XML contribution.

 

The only thing that works on that server (so far) was instead of using:

        $ch = curl_init();
       curl_setopt($ch, CURLOPT_URL, $url);
       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);
       // next two lines added to make it work on production server
       curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
       curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

using a method that was used as an alternative in "UPS XML Tracking, This code actually works...quite well!" http://www.oscommerce.com/forums/index.php?sho...ic=64498&st=200 (post 201).

 

There: exec('curl --data ' . escapeshellarg($xmlRequest) . ' ' . $url . '', $xmlResponse);

was used, the response is an array and instead of "return $xmlResponse;" you need to use:

return $xmlResponse[0];

 

Similar code is used by Authorize.Net Consolidated 1.7 (contribution 2184) by the way. You might need to use the full path to curl (e.g. exec('/usr/bin/curl --data ... etc.). See that contribution for code to get that automatically if exec is enabled on your server.

 

Trying to get more information, by using curl as above (which didn't work initially and I was trying different things) I also noticed that without cURL throwing any errors I would also get an empty array back as the response. This would inevitably cause the "Fatal error: Call to a member function on a non-object in /path/to/catalog/includes/classes/xmldocument.php on line 57" error.

 

Using curl on the command line I also had trouble with the https call if I didn't use also "-k" (insecure) option on that particular server. On Mac OSX I didn't have that.

 

Debugging curl from the command line (works on Linux and Mac OSX at least) might be not a bad option if you have trouble with this contribution.

 

This worked for example on the terminal window in Mac OS when I had the file upsxml_rq.txt (a request I copied and pasted from the upsxml.log) in my home directory (@~/upsxml_rq.txt didn't work for some reason):

 

curl --data @upsxml_rq.txt -v https://wwwcie.ups.com:443/ups.app/xml/Rate

--data-binary instead of --data (equivalent to -d) worked also.

Using the option -v gives more insight: you can also see if only a GET request is done and the file not posted (e.g. when I used @~/upsxml_rq.txt).

Link to comment
Share on other sites

Version 1.1.4 was just uploaded. Not interesting if you already have UPS XML working.

Some more logging of errors was added (cURL errors in particular) and also added the option to use cURL through exec(). In the end I found that I first had to do addslashes() on the request that is fed to the exec() statement, otherwise UPS would come back with a 10001 error: The XML document is not well formed. Rather peculiar I thought...

 

The "curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);" is commented out again. Only needed when you get a curl error 60: error setting certificate verify locations. You will only see that error when you have enabled logging though (in checkout_shipping.php you would see "An unknown error occured while attempting to contact the UPS Gateway" but that can have several causes.)

Link to comment
Share on other sites

Uhm.. quick question, guys... Maybe I missed something.

I'm still using the version that I uploaded back on the 17th of August (didn't realize, at the time, that this thread existed) and finally went live with it this week. So that if it was something tht's been addressed - or may be an issue with OSc itself, I apologize..

 

So, we get an order through the site, and I get an e-mail from my boss, going, "Which shipping method did they choose?"

I go in, and look at the e-mail sent - has NO mention of shipping method used. Log in as admin, look at the order, and again, has NO mention of shipping method used.

 

I know the customer's been charged for shipping, their order shows it. However, heck if I can find out anything about it. :)

 

Anything I should look for?

 

Fox.

Link to comment
Share on other sites

Strange, in the admin panel/order for an old test order on a test server I see for example (below the addresses, the payment method, and the list of products:

Sub-Total: $12.50

United Parcel Service (XML) (1 pkg x 1.475 lbs total) (UPS Ground (5 Business Days)): $4.96

Total: $17.46

OsC takes care of that, not the the UPS XML module as far as I know (just sends the options as quotes to the checkout_shipping.php page and there the customer picks his choice, osC does the rest.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...