Jump to content
torinwalker

New UPS XML Shipping Module available

Recommended Posts

But when I test the module against Canadian orders, it adds an additional option. This option is not displayed with a name or date. The only thing that shows up is the radio button and price. This option falls somewhere in between Standard and Express ... costs more than standard but less than express.
This has been reported before together with the fix. I thought it had been added to UPS XML by now, but apparently not.

 

catalog/includes/modules/shipping/upsxml.php should have this (about line 153-166):

			// Canada Origin
		'Canada Origin' => array(
			'01' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_01,
			'02' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_02,
			'07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_07,
			'08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_08,
			'11' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_11,
			'12' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_12,
			'13' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_13,
			'14' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_14,
			'54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_54,
			'65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_65
		),
		// European Union Origin

and the language file should include all these (about line 34-44):

			// Canada Origin
		'Canada Origin' => array(
			'01' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_01,
			'02' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_02,
			'07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_07,
			'08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_08,
			'11' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_11,
			'12' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_12,
			'13' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_13,
			'14' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_14,
			'54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_54,
			'65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_65
		),
		// European Union Origin

Share this post


Link to post
Share on other sites

Just an update on the problem I've been experiencing above .... I tried figuring out what value was being returned to the shop by the Rate and Service XML.

 

As some of you may know, the value that is returned to the shop is numeric and therefore a Human-readable Service Code lookup table is used to return the a specific options proper name. I've created a new name to see if I could narrow down which numeric value was responsible for the "Phantom" option.

 

	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_XX', 'Phantom UPS Option');

 

 

			// Canada Origin
		'Canada Origin' => array(
			'01' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_01,
			'02' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_XX,
			'07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_07,
			'08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_08,
			'11' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_11,
			'12' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_12,
			'13' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_13,
			'14' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_14,
			'54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_54,
			'65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_65
		),

 

I was able to attach a name to the phantom option when I captured value '2'. Not sure what this was intended to be but I guess it must be a new option available for Canadian Orders from Canadian origin. The checkout process seems to work fine when it has a name attached to it.

 

Anyone know what this option is supposed to be? I will see if I can contact UPS and ask them about this as well.

 

 

Thanks,

Olimess

Share this post


Link to post
Share on other sites

Oppps ... sorry JanZ. I guess we were both writing our replies at the same time. Sorry.

 

What should the language file include? you accidentally re-copied code from shipping file.

 

 

Thanks,

Olimess

Share this post


Link to post
Share on other sites
Oppps ... sorry JanZ. I guess we were both writing our replies at the same time. Sorry.
No need to apologize.
What should the language file include? you accidentally re-copied code from shipping file.
:blush:

Oops:

	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_01', 'UPS Express');
define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_02', 'UPS Expedited');
define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_07', 'UPS Worldwide Express');
define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_08', 'UPS Worldwide Expedited');
define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_11', 'UPS Standard');
define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_12', 'UPS 3 Day Select');
define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_13', 'UPS Express Saver');
define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_14', 'UPS Express Early A.M.');
define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_54', 'UPS Worldwide Express Plus');
define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_65', 'UPS Express Saver');

(Note the last one, don't know if it is in now, used to be wrong or missing).

Share this post


Link to post
Share on other sites

Ok JanZ. Read link you provided and tracked down the problem.

 

For anyone else having this issue, you need to add:

 

			// Canada Origin
		'Canada Origin' => array(
			'01' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_01,

//BOF add next line
			'02' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_02,
//EOF Add line above

			'07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_07,
			'08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_08,
			'11' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_11,
			'12' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_12,
			'13' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_13,
			'14' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_14,
			'54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_54,
			'65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_65
		),

 

To the UPSXML.php file (under includes/modules/shipping/) in and around line 158.

 

 

Olimess

Edited by Olimess

Share this post


Link to post
Share on other sites
Do you use GoDaddy?

:thumbsup:

 

Thanks for this great bit of info! Saved my hours and made my headache disappear!

Share this post


Link to post
Share on other sites

thanks for the help on my earlier problem janz.

got another problem though. does anyone know if i can remove UPS 2nd Day Air A.M. and UPS Next Day Air Early A.M. from my shipping choices?

 

UPS Ground

UPS 3 Day Select

UPS 2nd Day Air A.M.

UPS 2nd Day Air

UPS Next Day Air Early A.M.

UPS Next Day Air

 

upon doing my search for the answer i came across a post that had this as his shipping options so im guessing it is possible.

 

I got the following shipping choices by doing that:
UPS Ground $9.00
UPS 3 Day Select - 3 Business Days $16.04
UPS 2nd Day Air - 2 Business Days $20.64
UPS Next Day Air Saver - 1 Business Days $38.87
UPS Next Day Air - 1 Business Days @ 12:00 Noon $43.25

Share this post


Link to post
Share on other sites
sorry forgot to add that these A.M. options are not in my ups shipping module as you can see below.

 

UPS 2nd Day Air A.M.

UPS Next Day Air Early A.M.

 

did i install this incorrectly? if not, is there someway i can manually remove them?

Those methods are in the original upsxml.php file. Probably, you installed it by removing some shipping methods from the key MODULE_SHIPPING_UPSXML_TYPES (Step 5) and you removed those. It is a bit counter intuitive but you should have taken out shipping methods you do want to offer because those don't need to be excluded.

 

You can do it manually by going into the database table configuration and find the configuration key MODULE_SHIPPING_UPSXML_TYPES. To the field configuration_value you add , 2nd Day Air A.M., Next Day Air Early A.M.

 

To avoid problems when you need to edit the ups xml module and you lose them again it would be simpler to change the field set_function to text, restore the upsxml.php to have all the shipping options:

		// add key for disallowed shipping methods
	tep_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Disallowed Shipping Methods', 'MODULE_SHIPPING_UPSXML_TYPES', '', 'Select the UPS services <span style=\'color: red; font-weight: bold\'>not</span> to be offered.', '6', '20', 'tep_cfg_select_multioption(array(\'Next Day Air\', \'2nd Day Air\', \'Ground\', \'Worldwide Express\', \'Worldwide Express Plus\', \'Worldwide Expedited\', \'Express\', \'Standard\', \'3 Day Select\', \'Next Day Air Saver\', \'Next Day Air Early A.M.\', \'Expedited\', \'2nd Day Air A.M.\', \'Express Saver\', \'Express Early A.M.\', \'Express Plus\'), ',  now())");

and then do a quick remove, install of UPS XML (make a note of your settings first!).

Share this post


Link to post
Share on other sites

Hi everyone.

 

Great contribution ... major problem. First of all, let me inform you that I am a Canadian shop owner so UPS XML is being used from a Canadian origin ... although I don't believe that will make any difference at all to my issue.

 

I've searched for similar issues through out this thread but have been unable to locate any. I've also contact UPS on this issue but have not yet received a response.

 

Anyways .... on to my issue ...

 

I have installed the UPS XML with very little trouble. Everything works perfectly, until I decided to put it to some real life testing. I created several accounts of "mock" customers from different locations across the U.S., Canada and internationally. I placed orders using these mock customers to see what shipping cost I would be quoted for each location.

 

At first glance all appeared to be fine. It wasn't until I compared these rates with those issued through our UPS Connect software. The quotes are WAY off between the two. It then occured to me, we receive discounted rates from UPS due to the volume that we ship. So perhaps the UPS XML is not taking this into account. The question becomes ... are UPS XML files standard amongst all users, basically containing the same rate information for all or are the UPS XML files generated against user account?

 

In either case, how would someone in my position go about fixing/modifying the contribution to obtain our correct rates. I could stand the rates being off by a few cents but not by $5 or more!

 

All help/suggestions/info is greatly appreciated. Hopefully JanZ is reading this since he seems to be the man when it comes to this!

 

Thanks,

Olimess

Share this post


Link to post
Share on other sites
At first glance all appeared to be fine. It wasn't until I compared these rates with those issued through our UPS Connect software. The quotes are WAY off between the two. It then occured to me, we receive discounted rates from UPS due to the volume that we ship. So perhaps the UPS XML is not taking this into account. The question becomes ... are UPS XML files standard amongst all users, basically containing the same rate information for all or are the UPS XML files generated against user account?
There is a post in the thread somewhere by someone who experienced the same thing. Apparently the rates you get are standard rates. A bit strange since they ask for your UPS user name, UPS password, and UPS developer key before you get a rate...
In either case, how would someone in my position go about fixing/modifying the contribution to obtain our correct rates. I could stand the rates being off by a few cents but not by $5 or more!
If you know how UPS calculates the discount you can do the same. In the upsxml.php the spot where the handling cost are added is the most appropriate spot to tinker with 'cost' (starts around line 332):

// changed to make handling percentage based
				if ($this->handling_type == "Percentage") {
					$methods[] = array('id' => $type, 'title' => $_type, 'cost' => ((($this->handling_fee * $cost)/100) + $cost));
				} else {
					$methods[] = array('id' => $type, 'title' => $_type, 'cost' => ($this->handling_fee + $cost));
				}

Share this post


Link to post
Share on other sites

Thanks for the info JanZ. I figured as much. Took a look at the code myself after the last post and came to the same conclusion as you.

 

Just to take this issue a little further, here is what the UPS OnLineTools Rates and Service Selection XML Programming Information document had to say about Negotiated Rates.

 

Negotiated Rates refer to the rate displayed on the client system that has been rated using the

customer?s contractual incentive plan. Negotiated Rates will not always include all post-manifest

surcharges.

 

Negotiated Rates are only returned for qualified Shipper Account Numbers. Eligibility is

determined using the combination of Userid and the Shipper?s Shipper Account Number. If the user

is qualified, both Published rates and Negotiated Rates are returned to the user. If the Userid and

Shipper Account Number are not qualified for Negotiated Rates, a warning message is returned that

indicates ineligibility and only the Published rates are returned in the response.

The RSS tool will support Negotiated Rates for both Rate and Rate Shop Requests. (For more

information on Rate and Rate Shop Requests refer sections, Rating a Specific Service and Rate

Shopping)

 

A little further down in the document we encounter ...

 

A shipper number is required when requesting to receive the negotiated rates. The shipper number is optional when requesting to receive the published rates.

 

The starting to shed some light on this thing. Again, further down we find ...

 

Negotiated Rates are available in the UPS Customer Integration Environment and are returned

when the Negotiated Rate indicator is provided in the rate request. The Negotiated Rates returned

do not reflect the contractual rate and may vary.

 

Also in the Customer Integration Environment the shipper eligibility for Negotiated Rates is not fully

verified. For shipper eligibility requirements refer to Negotiated Rates section within UPS Rates &

Service Selection.

 

Now we see why I have been getting the "wrong" rates. I haven't yet checked to see if the UPS XML contribution offers Negotiated Rates ability (although I seriously doubt it) but I will check none the less.

 

Too bad I couldn't add attachments to my post otherwise I would gladly provide the UPS OnLineTools Rates and Service Selection XML Programming Information document for all those who cared to take a look.

 

I'll be back shortly with my findings.

 

 

Thanks for your time all,

Chao

Share this post


Link to post
Share on other sites
Too bad I couldn't add attachments to my post otherwise I would gladly provide the UPS OnLineTools Rates and Service Selection XML Programming Information document for all those who cared to take a look.
I have checked the UPS OnLine Tools, Rates and Service Selection, XML Programming Information, Version 1.0, Volume 6, Number 1, Revision Date: January 1, 2006 that I have and in those 126 pages the word "Negotiated" is not found. I don't know what your version is but you can forget about finding it in the UPS XML contribution.

Share this post


Link to post
Share on other sites

The file name that I have is RSS-WW-XML.pdf and the document title/volume is:

 

UPS OnLine Tools

Rates and Service Selection

XML Programming Information

 

Volume 6, Number 3

Revision Date: July 15, 2006

 

 

I did a search in the contribution as well and didn't find any mention of negotiated. However, you'd figure that if all the that is needed is the Shipper account number to be sent and varified in order for the negotiated rates to be returned .. it couldn't be that hard to do could it?

 

I can send you my version of the UPS XML Programming document if you like.

 

Cheers,

Olimess

Share this post


Link to post
Share on other sites

Hi all.

 

 

JanZ ... I just received your PM as I logged in. I went through the code today and added/changed the following with regards to Negotiated Rates for UPS XML. I'm sure you did the same on your end as well.

 

I'll post below for other users but by the sounds of it you are going to be extending this further into the contribution to have it defined in the admin etc. I was thinking of doing the same but no sense in having us both work at the same thing.

 

Anyways, for all those who need Negotiated Rates from the UPS XML, you can do the following ...

 

 

At about line 654 add the following in between the Shipper and Address tag ...

 

		"	   <Shipper>\n".
	"		   <ShipperNumber>YOURACCOUNTNUMBER</ShipperNumber>\n".
	"		   <Address>\n".

 

 

I found that the next line was not really necessary, although the programming information for UPS XML said it was necessary.

 

At about line 717, just before the closing Shipment tag, add ..

 

		"	   <RateInformation>\n".
	"		   <NegotiatedRatesIndicator/>\n".
	"	   </RateInformation>\n".

 

 

Finally, change the following line at somewhere around 875 or so ...

 

			//$totalCharge = $ratedShipments[$i]->getValueByPath("/TotalCharges/MonetaryValue");

 

to ...

 

			$totalCharge = $ratedShipments[$i]->getValueByPath("/NegotiatedRates/NetSummaryCharges/GrandTotal/MonetaryValue");

 

 

That's it!

 

This can be done in a much smoother way if added properly to the contribution .... via admin etc. As I said above, I believe JanZ is working on this now so we'll wait and see his fine work. For now, this is the quick and dirty method.

 

JanZ, let me know if I can be of any assistance .... although I doubt you'll need it.

 

 

Olimess

Share this post


Link to post
Share on other sites

Hi guys,

 

Thanks for a very awesome module. But I have a small problem, I can't seem to "disallow" any of the shipping types. The configuration_value field contains only the word 'Array'. I manually update this with a comma separated values of the types I do not want, but I'm worried that I messed up something installing the module. I haven't done php in a while, so am I missing something here? What should I be looking for?

Share this post


Link to post
Share on other sites
I have a small problem, I can't seem to "disallow" any of the shipping types. The configuration_value field contains only the word 'Array'. I manually update this with a comma separated values of the types I do not want, but I'm worried that I messed up something installing the module. I haven't done php in a while, so am I missing something here? What should I be looking for?
I suspect you missed step 3 of the readme.txt. The manual update shouldn't give any problems, until you change a setting again of course and need to do it again.

Share this post


Link to post
Share on other sites
I suspect you missed step 3 of the readme.txt. The manual update shouldn't give any problems, until you change a setting again of course and need to do it again.

Ah, duh! Not sure how I missed that.

Share this post


Link to post
Share on other sites

I am having a problem with the data not being saved when I edit and update the information in the admin panel. I enter my Access Key, Username etc. and click update, but no information is saved. I have removed the module and re-installed it but that did not help. Any idea what is happening here?

Share this post


Link to post
Share on other sites

Okay, I don't really know where to begin, but here it goes.

 

I have installed this lovely contribution, but it is not showing up when I go to check out. I edited the admin portion of it correctly and I have only changed certain layout options on the checkout_shipping.php file. The other shipping options show up and work when checking out, but this one does not. Has anybody come accross this problem, and if so, what was the solution? I'm pulling my hair and only have a couple of strands left, and help would be awesome!

 

Here is the site that I'm working on right now.

 

Silverstone Wireless

Share this post


Link to post
Share on other sites

Isailor,

 

Can you update anything else on that page?

 

I ran into some database problems when uninstalling and reinstalling the module. Check your database using phpmyadmin or the like and make sure it is structured properly. Mine created multiple entries in the configuration table and so I manually deleted them.


John Wisdom

Share this post


Link to post
Share on other sites
Okay, I don't really know where to begin, but here it goes.

 

I have installed this lovely contribution, but it is not showing up when I go to check out. I edited the admin portion of it correctly and I have only changed certain layout options on the checkout_shipping.php file. The other shipping options show up and work when checking out, but this one does not. Has anybody come accross this problem, and if so, what was the solution? I'm pulling my hair and only have a couple of strands left, and help would be awesome!

 

Hi Todd,

 

When you are in admin/modules/shipping do you have the module enabled and the proper values entered? Have you tried running the log?


John Wisdom

Share this post


Link to post
Share on other sites
Hi Todd,

 

When you are in admin/modules/shipping do you have the module enabled and the proper values entered? Have you tried running the log?

 

John, thank you for your response. I do have everything in there how it should be, and it is enabled. I triple checked to make sure that I have all of the files uploaded and in the right place. I enabled the logging, but it doesn't seem to be doing anything. With logging enabled, when I go to checkout it will show something in the log file, is this correct? I'm not 100% sure how the logging works.

Share this post


Link to post
Share on other sites

Okay, I don't know what happened, but I tried it again, and this is what came up.

 

10002: The XML document is well formed but the document is not valid

Edited by todd-imc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×