Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New UPS XML Shipping Module available


Recommended Posts

Hi;

 

I have the UPS Xml module installed and it works well :thumbsup:

 

Qwik question though, I have my store set up in Canada and the UPS section of the checkout always only shows one UPS Method and that's Standard.

 

Is this normal or should it show more UPS options?

 

Thanks;

Marvin

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

Link to comment
Share on other sites

Just posted a new updated module to contributions which addresses the ready-to-ship package count errors as well as providing a quick means of enabling/disabling the Ground Time In Transit API (should you encounter problems with as pointed out in some of the previous posts)

 

UPSXML Rates & Services 1.1

 

Marvin;

 

I've never tried setting this up from a Canadian origin, but it appears that if you have all shipping options enabled, you should see UPS Express, UPS Expedited, UPS Worldwide Express, UPS Worldwide Expedited, UPS Standard, UPS 3 Day Select, UPS Express Saver, UPS Express Early A.M. and UPS Worldwide Express Plus (depending on shipping destination).

 

I don't know if what I did to enable selectable options would have an adverse effect on what you are able to offer from any origin other than the US. If you are sure that you've tried enabling all options and still get only Standard from Canada, you might try loading version 1.02 which was the last version posted by the original author (who I believe was also shipping from Canada), and did not include the ability to limit the options shown to the customer.

 

... or someone else reading this thread who is successfully using the current version might have some insight.

... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Link to comment
Share on other sites

I get this when loading my admin shipping screen (at step 7):

 

Warning: main(includes/classes/xmldocument.php): failed to open stream: No such file or directory in /home/blades/public_html/includes/modules/shipping/upsxml.php on line 22

 

Fatal error: main(): Failed opening required 'includes/classes/xmldocument.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/blades/public_html/includes/modules/shipping/upsxml.php on line 22

 

I've gone through the steps several times, but I must be missing something... any ideas?

Link to comment
Share on other sites

I get this when loading my admin shipping screen (at step 7):

 

Warning: main(/home/... /public_html/store/includes/languages/english/modules/shipping/upsxml_back_known.php): failed to open stream: No such file or directory in /home/... /public_html/store/admin/modules.php on line 132

 

Warning: main(/home/... /public_html/store/includes/languages/english/modules/shipping/upsxml_back_known.php): failed to open stream: No such file or directory in /home/... /public_html/store/admin/modules.php on line 132

 

Warning: main(): Failed opening '/home/... /public_html/store/includes/languages/english/modules/shipping/upsxml_back_known.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/... /public_html/store/admin/modules.php on line 132

 

Fatal error: Cannot redeclare class xmldocument in /home/... public_html/store/admin/includes/classes/xmldocument.php on line 19

 

upsxml_back_known.php doesn't exist but I think it should be pointing to upsxml.php

 

why is it doing such?

Link to comment
Share on other sites

Also, site gives me the error

 

No data returned from Fedex, perhaps the Fedex site is down 

 

United Parcel Service (XML)   

Rating and Service 1.0001 0 An unknown error occured while attempting to contact the UPS gateway : Rating and Service 1.0001 0 An unknown error occured while attempting to contact the UPS gateway

 

Yet when I look at my log I see a response from UPS - here's the response

 

UPS RESPONSE: <?xml version="1.0"?><RatingServiceSelectionResponse>
<Response>
<TransactionReference>
<CustomerContext>Rating and Service</CustomerContext>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<ResponseStatusCode>1</ResponseStatusCode>
<ResponseStatusDescription>Success</ResponseStatusDescription>
</Response>
<RatedShipment>
<Service><Code>07</Code></Service>
<BillingWeight>
<UnitOfMeasurement><Code>KGS</Code></UnitOfMeasurement>
<Weight>1.0</Weight>
</BillingWeight>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>32.55</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>32.55</MonetaryValue></TotalCharges>
<GuaranteedDaysToDelivery></GuaranteedDaysToDelivery><ScheduledDeliveryTime></ScheduledDeliveryTime><RatedPackage><TransportationCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TotalCharges><Weight>1.0</Weight><BillingWeight><UnitOfMeasurement><Code> </Code></UnitOfMeasurement><Weight> </Weight></BillingWeight></RatedPackage></RatedShipment><RatedShipment><Service>
<Code>08</Code></Service><BillingWeight><UnitOfMeasurement><Code>KGS</Code></UnitOfMeasurement><Weight>1.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>30.87</MonetaryValue></TransportationCharges>
<ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>30.87</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery></GuaranteedDaysToDelivery>
<ScheduledDeliveryTime></ScheduledDeliveryTime><RatedPackage><TransportationCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TransportationCharges>
<ServiceOptionsCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TotalCharges><Weight>1.0</Weight><BillingWeight><UnitOfMeasurement><Code> </Code></UnitOfMeasurement><Weight> </Weight></BillingWeight></RatedPackage></RatedShipment><RatedShipment><Service><Code>54</Code></Service><BillingWeight><UnitOfMeasurement><Code>KGS</Code></UnitOfMeasurement><Weight>1.0</Weight></BillingWeight><TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>60.05</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>60.05</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery></GuaranteedDaysToDelivery>
<ScheduledDeliveryTime></ScheduledDeliveryTime><RatedPackage><TransportationCharges>
<CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode> </CurrencyCode>
<MonetaryValue> </MonetaryValue></TotalCharges><Weight>1.0</Weight><BillingWeight><UnitOfMeasurement><Code> </Code></UnitOfMeasurement><Weight> </Weight></BillingWeight></RatedPackage></RatedShipment></RatingServiceSelectionResponse>

 

 

Everything was working fine on the site then suddenly all these issues appeared

 

- bad file reference in admin/modules.php

- Cannot redeclare class xmldocument

- tells me that ups caused an unknown error and no data was returned. Yet I get a response from UPS and data was returned

 

I've reinstalled and configured the latest UPS XML pack module.

I did all the recommended changes from the forums, still with no luck.

 

please help!

Link to comment
Share on other sites

Marvin;

 

I've never tried setting this up from a Canadian origin, but it appears that if you have all shipping options enabled, you should see UPS Express, UPS Expedited, UPS Worldwide Express, UPS Worldwide Expedited, UPS Standard, UPS 3 Day Select, UPS Express Saver, UPS Express Early A.M. and UPS Worldwide Express Plus (depending on shipping destination).

 

I don't know if what I did to enable selectable options would have an adverse effect on what you are able to offer from any origin other than the US. If you are sure that you've tried enabling all options and still get only Standard from Canada, you might try loading version 1.02 which was the last version posted by the original author (who I believe was also shipping from Canada), and did not include the ability to limit the options shown to the customer.

 

... or someone else reading this thread who is successfully using the current version might have some insight.

Interesting... The version I installed was the last one the original author made (1.04) when I was installing it though the instructions said this;

 

"The configuration key which allows for selecting the types of methods to show your customers is type "VARCHAR(255)" in the stock osC installation, which is not long enough to hold all of the possible UPS methods.

 

You have 2 options to deal with this:

 

1) Go to the configuration table in your database and change the type for

field "set_function" from VARCHAR(255) to TEXT

 

That's what I would like to do (and maybe it's causing the problem) but it doesn't say what table or name it is!

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

Link to comment
Share on other sites

Hmmm... I found it!

 

Guess what? It's located in the table called CONFIGURATION - just as written in the instructions above - doH!

 

However, I still only see the UPS standard option available. Maybe I should remove this UPS version and install the latest one you made instead?

 

That way hopefully I can get the dimensions working too :thumbsup:

 

Stuart, you are really a big help to everyone here. I was going through this thread and saw tons of posts from you helping out everyone - so Thank You!

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

Link to comment
Share on other sites

Marvin;

 

The last version that the original author (Torin Walker) submitted for this contribution was 22 Jul 2003 - UPS XML Update 1.02

 

The v1.04 already has the selectable method modification in it. I don't know why this would prevent all available methods from Canada to appear, but if you want to see if it does, try loading the v1.02 which didn't have selectable options. BACKUP first!

 

PS - Does anyone who's shipping FROM Canada have the more recent versions working successfully and showing all available options so we can help Marvin sort this out?

... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Link to comment
Share on other sites

Marvin;

 

Does anyone who's shipping FROM Canada have the more recent versions working successfully and showing all available options so we can help Marvin sort this out?

Hi Stuart;

 

I just did a re-install on a new store using your latest version of this contribution and I can now confirm that there should be a whole bunch of options available for UPS shipping from Canada.

 

I have at least 3 from my area and if I use different customer addresses from Europe, USA and the Middle East I then get different rates/options for each destination so it looks like everything is working well.

 

I'm going to move on to the dimensional support and see if that works for me too. Qwik question, in the docs it mentions Time in Transit. What does that mean?

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

Link to comment
Share on other sites

Jan,

 

Thanks for the help.

 

I fixed the bad file reference in admin/modules.php and the cannot redeclare class xmldocument.

 

What I did is that I put the upsxml.php and I copied the same file to a new name upsxml_back_known.php because no file existed anywhere on my site folder or on server. The scripts for some strange reason where looking for that innexistent file - I though the script should have been referencing upsxml.php - so I just copied that file with the weird name.

 

Then the only error that I got was the redeclare class error in the xmldocument..... after that I decided to remove the upsxml_back_known.php that I just put in (which wasn't there to begin with, when I was getting the error) - the problems then fixed themselves in the admin section - very strange....

 

I'm still having that problem with the ups modules - I get data back from UPS - their data looks well codded but there are no line breaks (looks like a cluster) in the log.

 

The site still gives me the error "Rating and Service 1.0001 0 An unknown error occured while attempting to contact the UPS gateway : Rating and Service 1.0001 0 An unknown error occured while attempting to contact the UPS gateway"

 

This is strange because everything was working fine a week or two ago. I did all the upgrades as you guys suggested but still am getting that error.

 

Customers are asking me why they can't order and where loosing business... ahhhhhh :'(

Link to comment
Share on other sites

eWok,

 

Somebody else (and I too) had the same error see: http://www.oscommerce.com/forums/index.php?showtopic=121468

 

It looks like a suggestion from another thread (I think it was on UPSXML Tracking) seems to work for this too. Perhaps it has to do with Apache 1 versus Apache 2.

 

after that I decided to remove the upsxml_back_known.php that I just put in (which wasn't there to begin with, when I was getting the error) - the problems then fixed themselves in the admin section - very strange....
Actually not, the osC code lists all the modules in "shipping" and then starts looking for files of the same name in the language directory. If there are backup files in the directory shipping....you get the picture. Edited by JanZ
Link to comment
Share on other sites

Does anyone know about this error? Someone asked about it before but there was no response - now I'm getting it too :huh:

 

It comes up when you try to define a new package in the admin...

 

Warning: Missing argument 1 for shownewpackageform() in /home/frostysa/public_html/catalog2/admin/packaging.php on line 196

 

Line 196 in packaging.php is;

 

function showNewPackageForm($error) {

 

Any ideas on this one? I think it was a common error but I'll be darned if I can find it :thumbsup:

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

Link to comment
Share on other sites

Marvin;

 

Glad to hear things appear to be moving in the right direction now.

The Time In Transit as far as I have been able to tell only gives Ground Business Days in transit from US origins to US destinations. I think the UPS server which provides this info is also somewhat unreliable (just a guess on my part).

 

In UPSXML version 1.1, I made the default installation with the code that calls the Time In Transit functions commented out. If you are shipping froom Canada, I would just leave it commented out.

 

As to the packaging error, give me a while to search back through and see if I can find what the resolution to that was - I'm pretty sure I can find it waayyy back in the older posts.

... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Link to comment
Share on other sites

Jan,

 

Thanks for the link but those changes are already implemented on the site (most of it was on the new version of the module) and i'm still getting that error.

 

My shipping starting point is from Mexico though, if this helps....

 

I spent many hours on this and I have no idea what's going wrong

Link to comment
Share on other sites

Marvin (and everyone else) I apologize...

 

I don't know where the "$error" in the packaging.php came from, but it seems to appear in 2 places.

 

At line 196, change

function showNewPackageForm($error) {

to read

function showNewPackageForm() {

and at line 225, change

function showUpdatePackageForm($error) {

to read

function showUpdatePackageForm() {

Let us know if that corrects the problem.

... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Link to comment
Share on other sites

I did enable logging and I get no error from ups and they return data to our server. I get that unknown error on the site

 

UPS returns this data.

 

UPS RESPONSE: <?xml version="1.0"?><RatingServiceSelectionResponse><Response><TransactionReference><CustomerContext>Rating and Service</CustomerContext><XpciVersion>1.0001</XpciVersion></TransactionReference><ResponseStatusCode>1</ResponseStatusCode><ResponseStatusDescription>Success</ResponseStatusDescription></Response><RatedShipment><Service><Code>07</Code></Service><BillingWeight><UnitOfMeasurement><Code>KGS</Code></UnitOfMeasurement><Weight>1.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>32.55</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>32.55</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery></GuaranteedDaysToDelivery><ScheduledDeliveryTime></ScheduledDeliveryTime><RatedPackage><TransportationCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TotalCharges><Weight>1.0</Weight><BillingWeight><UnitOfMeasurement><Code> </Code></UnitOfMeasurement><Weight> </Weight></BillingWeight></RatedPackage></RatedShipment><RatedShipment><Service><Code>08</Code></Service><BillingWeight><UnitOfMeasurement><Code>KGS</Code></UnitOfMeasurement><Weight>1.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>30.87</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>30.87</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery></GuaranteedDaysToDelivery><ScheduledDeliveryTime></ScheduledDeliveryTime><RatedPackage><TransportationCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TotalCharges><Weight>1.0</Weight><BillingWeight><UnitOfMeasurement><Code> </Code></UnitOfMeasurement><Weight> </Weight></BillingWeight></RatedPackage></RatedShipment><RatedShipment><Service><Code>54</Code></Service><BillingWeight><UnitOfMeasurement><Code>KGS</Code></UnitOfMeasurement><Weight>1.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>60.05</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>60.05</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery></GuaranteedDaysToDelivery><ScheduledDeliveryTime></ScheduledDeliveryTime><RatedPackage><TransportationCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode> </CurrencyCode><MonetaryValue> </MonetaryValue></TotalCharges><Weight>1.0</Weight><BillingWeight><UnitOfMeasurement><Code> </Code></UnitOfMeasurement><Weight> </Weight></BillingWeight></RatedPackage></RatedShipment></RatingServiceSelectionResponse>

Link to comment
Share on other sites

Marvin (and everyone else) I apologize...

 

I don't know where the "$error" in the packaging.php came from, but it seems to appear in 2 places.

 

At line 196, change

function showNewPackageForm($error) {

to read

function showNewPackageForm() {

and at line 225, change

function showUpdatePackageForm($error) {

to read

function showUpdatePackageForm() {

Let us know if that corrects the problem.

 

That seems to have fixed it for me - way to go! :D

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

Link to comment
Share on other sites

Just uploaded version 1.1.1 which corrects the following errors:

 

Changes from 1.1 to 1.1.1

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

1. Corrected misspelling in catalog/includes/modules/shipping/upsxml.php line 647:

$sheduledTime = $ratedShipments[$i]->getValueByPath("/ScheduledDeliveryTime");

corrected to read

$scheduledTime = $ratedShipments[$i]->getValueByPath("/ScheduledDeliveryTime");

2. In catalog/admin/packaging.php, there were 2 instances where a "$error" had somehow crept into the code:

Line 196

function showNewPackageForm($error) {

corrected to read

function showNewPackageForm() {

and line 225

function showUpdatePackageForm($error) {

corrected to read

function showUpdatePackageForm() {

 

Complete package in contributions:

UPSXML v1.1.1

... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Link to comment
Share on other sites

eWok,

 

I just changed the UPSXML module to the last one of Stuart 1.1.1 and used the UPSXML module of Greg MacLellan. I added in his options for the Shipping Delay, but that shouldn't make a difference for the error. When I use the module as is (OK, with the correct path to the log file) I get the same error as you did (after I changed the typo of the UNKNWON error that slipped back in, in his upsxml.php file):

"Rating and Service 1.0001 0 An unknown error occured while attempting to contact the UPS gateway"

 

When I add in the extra CURL options (see code below): things work again.

   curl_setopt($ch, CURLOPT_TIMEOUT, (int)$timeout);
  // see www.oscommerce.com/forums/index.php?showtopic=49832&st=100
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

Link to comment
Share on other sites

I just installed version 1.1.1 and now have a problem so I will be removing it until it can be fixed.

 

1) I removed the original ups.php from the server after uninstalling that shipping module.

 

2) I installed version 1.1.1 of the UPS XML shipping module.

 

3) After installation, I clicked on the EDIT button

 

4) The edit screen came up but I noticed that at the top of the page, I get the following error message...

Parse error: parse error, unexpected ';' in /home/popthet/public_html/catalog/admin/modules.php(235) : eval()'d code on line 1

 

This is the code in admin/modules.php...

 ?switch ($action) {
? ?case 'edit':
? ? ?$keys = '';
? ? ?reset($mInfo->keys);
? ? ?while (list($key, $value) = each($mInfo->keys)) {
? ? ? ?$keys .= '<b>' . $value['title'] . '</b><br>' . $value['description'] . '<br>';

? ? ? ?if ($value['set_function']) {
HERE -> ?eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');");
? ? ? ?} else {
? ? ? ? ?$keys .= tep_draw_input_field('configuration[' . $key . ']', $value['value']);
? ? ? ?}
? ? ? ?$keys .= '<br><br>';
? ? ?}
? ? ?$keys = substr($keys, 0, strrpos($keys, '<br><br>'));

 

Does anyone know how to fix this???

Edited by PopTheTop

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

Scott;

 

Did you make the configuration key change per step 5 of the installation instructions? I think that's what causes that particular error.

... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

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...