Jump to content
torinwalker

New UPS XML Shipping Module available

Recommended Posts

Could somebody please shed some light on this.. It's important that I get this working as fast as I possibly can.

 

Also, I've contacted UPS.. But i'm waiting for email back from them with information pertaining to this issue.. Basically I'm trying to cover all my bases so I don't miss anything. And ultimately find out what the cause of this problem is..

 

Thank you,

 

Christine


If it ain't broke, don't fix it! :)

Share this post


Link to post
Share on other sites
Until I go to check out.. And this is the error I'm getting..
The problem seems obvious. Either a snafu with UPS, or.... you didn't type it exactly as you received it (capitals do matter).

 

Or maybe you entered the address/zipcode of your dropshipper in the admin of the shop and UPS doesn't like that (not likely, might be an idea to get more accurate rates).

Share this post


Link to post
Share on other sites
Jan I have it working!!!!! Yes you heard me right.
That is good news.
We only have one last liitle issue to clear up and that is it still ends with a sceong rate request that is double item quantity. I can't for the life of me figure out why it is doing this. The shipping charges that are posted to the customer are from the first (correct) request and not the second (double and wrong) request so it isn't a huge issue.
You got me stomped there. If it were "just" a second rate request (not two timeinTransit requests?) I would suppose that perhaps there is something in the MVS code that triggers that, but with double the quantity and only the rate request.... :o

 

The insurance thing is only adding in some code I think. In the older UPS versions that code was commented out, but in the MVS code it is taken out. IMO it has to be inserted in _upsGetQuote in this piece of code, between </ PackageWeight > and </ Package >:

$ratingServiceSelectionRequestPackageContent .=
" <PackageWeight>\n".
" <UnitOfMeasurement>\n".
" <Code>". $this->unit_weight($vendors_id) ."</Code>\n".
" </UnitOfMeasurement>\n".
" <Weight>". $this->item_weight[$i] ."</Weight>\n".
" </PackageWeight>\n".
" </Package>\n";
}

That piece of code being:

			"		   <PackageServiceOptions>\n".
		"			   <InsuredValue>\n".
		"				   <CurrencyCode>".MODULE_SHIPPING_UPSXML_CURRENCY_CODE."</CurrencyCode>\n".
		"				   <MonetaryValue>".$this->pkgvalue."</MonetaryValue>\n".
		"			   </InsuredValue>\n".
		"		   </PackageServiceOptions>\n".

Share this post


Link to post
Share on other sites
it still ends with a sceong rate request that is double item quantity. I can't for the life of me figure out why it is doing this.
Perhaps this line has something to do with it (somewhere around line 880, in the _upsGetQuote function:

if ($this->dimensions_support($vendors_id) == '1' || '2') {

Since '2' will always be true, perhaps it is going through that twice?

I think it should be:

if ($this->dimensions_support($vendors_id) == '1' || $this->dimensions_support($vendors_id) == '2') {

Then I come back to one of my original suspicions: does the code know about the $vendors_id everywhere since it enters in the function quote. Perhaps you should try to log the $vendors_id on a few places with the error_log code and see what that gives.

Share this post


Link to post
Share on other sites
Perhaps this line has something to do with it (somewhere around line 880, in the _upsGetQuote function:

if ($this->dimensions_support($vendors_id) == '1' || '2') {

Since '2' will always be true, perhaps it is going through that twice?

I think it should be:

if ($this->dimensions_support($vendors_id) == '1' || $this->dimensions_support($vendors_id) == '2') {

Then I come back to one of my original suspicions: does the code know about the $vendors_id everywhere since it enters in the function quote. Perhaps you should try to log the $vendors_id on a few places with the error_log code and see what that gives.

ceil($order->info['subtotal'])

This is pulling nothing. It ends up being empty. So this array isn't being set in MVS while it is getting set in regular osC

Edited by HallMarc

Share this post


Link to post
Share on other sites
ceil($order->info['subtotal'])

This is pulling nothing. It ends up being empty. So this array isn't being set in MVS while it is getting set in regular osC

True, you made it into a function, add global $order; as the first line in that function.

Share this post


Link to post
Share on other sites
True, you made it into a function, add global $order; as the first line in that function.

Ok so what about the error email?

Share this post


Link to post
Share on other sites
The problem seems obvious. Either a snafu with UPS, or.... you didn't type it exactly as you received it (capitals do matter).

 

Or maybe you entered the address/zipcode of your dropshipper in the admin of the shop and UPS doesn't like that (not likely, might be an idea to get more accurate rates).

 

Hi Jan.. Thanks for your help.. But just so you know.. I copied and pasted the access key they gave me right from the email to the module in admin.. And the address i'm using is my own.. Just as you said.. I didn't want to complecate matters by putting something other than the address in which i've signed up with UPS .. Ya know? :)

 

So what do you think Jan? You think this is UPS? Or no? Cause i'm lost.. And error like this can't be produced by the shop can it? I'm thinkin this came directly from UPS.. And my instincts say it's UPS's fault here.. But what do I know.. lol I just want it working so I can get moving on my shop and get it done..

 

Looking forward to hearing back from you..

 

Thanks again,

 

Christine


If it ain't broke, don't fix it! :)

Share this post


Link to post
Share on other sites
Hi Jan.. Thanks for your help.. But just so you know.. I copied and pasted the access key they gave me right from the email to the module in admin.. And the address i'm using is my own.. Just as you said.. I didn't want to complecate matters by putting something other than the address in which i've signed up with UPS .. Ya know? :)

 

So what do you think Jan? You think this is UPS? Or no? Cause i'm lost.. And error like this can't be produced by the shop can it? I'm thinkin this came directly from UPS.. And my instincts say it's UPS's fault here.. But what do I know.. lol I just want it working so I can get moving on my shop and get it done..

 

Looking forward to hearing back from you..

 

Thanks again,

 

Christine

I would contact UPS and whicj version of this module are you using?

 

 

Jan, I feel like a complete moron now. Thanks dude! Sometimes the most obvious eludes us. global $order; was the right fix.

 

Now if I can just get the error email to function.

 

Lastly, both requests are being sent twice but only in the rates request do the items get doubled. And, no it isn't related to the number of vendors or the number of items.

Share this post


Link to post
Share on other sites
I would contact UPS and whicj version of this module are you using?

Jan, I feel like a complete moron now. Thanks dude! Sometimes the most obvious eludes us. global $order; was the right fix.

 

Now if I can just get the error email to function.

 

Lastly, both requests are being sent twice but only in the rates request do the items get doubled. And, no it isn't related to the number of vendors or the number of items.

 

Yes.. I've contacted UPS.. But their response could take up to 3 business days.. pfft.. lol

 

And the version i'm using is from here http://www.oscommerce.com/community/contri...ry/search,70785

and it's from DefelRadar on Feb 7th, 2006. I believe it's version 1.2.3.1

Is that okay?

 

Christine


If it ain't broke, don't fix it! :)

Share this post


Link to post
Share on other sites
Yes.. I've contacted UPS.. But their response could take up to 3 business days.. pfft.. lol

 

And the version i'm using is from here http://www.oscommerce.com/community/contri...ry/search,70785

and it's from DefelRadar on Feb 7th, 2006. I believe it's version 1.2.3.1

Is that okay?

 

Christine

I just wanted to know as there are differences between this one and the previous version. Nothing big.

Edited by HallMarc

Share this post


Link to post
Share on other sites
I just wanted to know as there are differences between this one and the previous version. Nothing big.

 

Hey, I'm not sure.. And I feel kinda dumb now.. But I think my account with my developers key has to be approved before they let my access key work.. So I'm not positive.. But if this is true.. Then this whole issue is UPS's fault.. And i'll have to wait it out.. Which is pretty stupid in my opinion.. lol

 

But anyways.. I'll let you guys know either way when I find out for certain..

 

Thank you all again for your help!

 

Christine


If it ain't broke, don't fix it! :)

Share this post


Link to post
Share on other sites
Now if I can just get the error email to function.
There are two ways to use error_log: either to log or to get an email. For examples see these lines:

			// send email if enabled in the admin section
		if ($this->email_errors) {
			error_log("UPSXML TimeInTransit Error: " . $errorMsg . " experienced by customer with id " . $_SESSION['customer_id'] . " on " . date('Y-m-d H:i:s'), 1, STORE_OWNER_EMAIL_ADDRESS);
		}
		// log errors to file ups_error.log when set
		if ($this->ups_error_file) {
			error_log(date('Y-m-d H:i:s')."\tTimeInTransit\t" . $errorMsg . "\t" . $_SESSION['customer_id'] ."\n", 3, $this->ups_error_file);	
		}

Share this post


Link to post
Share on other sites
There are two ways to use error_log: either to log or to get an email. For examples see these lines:

			// send email if enabled in the admin section
		if ($this->email_errors) {
			error_log("UPSXML TimeInTransit Error: " . $errorMsg . " experienced by customer with id " . $_SESSION['customer_id'] . " on " . date('Y-m-d H:i:s'), 1, STORE_OWNER_EMAIL_ADDRESS);
		}
		// log errors to file ups_error.log when set
		if ($this->ups_error_file) {
			error_log(date('Y-m-d H:i:s')."\tTimeInTransit\t" . $errorMsg . "\t" . $_SESSION['customer_id'] ."\n", 3, $this->ups_error_file);	
		}

Jan, I know that much! :lol: The MVS version is not sending any emails. The email check (yes : no) is also vendor specific so it is wrapped in a function. Now IMO that shouldn't effect STORE_OWNER_EMAIL_ADDRESS but I think it isn't being set for some reason.

Edited by HallMarc

Share this post


Link to post
Share on other sites

Also, in order to place insurance for just the items for that particulr vendor I had to change

// insurance addition
function pkgvalue($vendors_id) {
global $order;

if (constant('MODULE_SHIPPING_UPSXML_INSURE_' . $vendors_id) == 'False')
{ $this->pkgvalue = 100; }
if (constant('MODULE_SHIPPING_UPSXML_INSURE_' . $vendors_id) == 'True')
{ $this->pkgvalue = ceil($order->info['subtotal']); }
// end insurance addition
return $this->pkgvalue;
}

to this

// insurance addition
function pkgvalue($vendors_id) {
global $cart;
if (constant('MODULE_SHIPPING_UPSXML_INSURE_' . $vendors_id) == 'False')
{ $this->pkgvalue = 100; }
if (constant('MODULE_SHIPPING_UPSXML_INSURE_' . $vendors_id) == 'True')
{ $this->pkgvalue = $cart->vendor_shipping[$vendors_id]['cost']; }
// end insurance addition
return $this->pkgvalue;
}

Share this post


Link to post
Share on other sites

I have added in the great module. Well I think it's great from all I've read.

 

Well I'm having a problem, one I'm sure I caused due to something I did not understand (and something I just plain screwed up on).

 

I installed the module without the dimension support and all went well untill I got to the shipping method issue. I couldn't find any field to modify called set_function so I went into the upsxml.php to remove the shipping methods from the key MODULE_SHIPPING_UPSXML_TYPES and remove the values. I did so, or thought I did. What I actually did because I couldn't find the code at line 291 I used the search feature to find the key and accidently removed the values from the key which set which values to show for the selction of what types not to show that you used in the admin panel.

 

Well needless to say once I caught the mistake I reloaded the module and reinstalled it. However I cannot get the other options to show up as far as "not showing" them. Does the current version of the module require a different solution for this field length or has it been rectified? All other code changes sent perfectly and the module appears to work although we did not finish the test order to avoid any errors when all the shipping methods show'd up and we only want standard and ground to show.

 

Again the field set_function is not in my database. I did a comple search of it so I also wonder if I was supposed to do something with the SQL files. There was nothing on them in the instructions. I'm still looking through this thread. It's length makes it difficult though and I've found nothing using the forum search and this is the last step before we can go live.

 

Anyone that can get me on the right track I'd very much appriciate it.

 

Paul

Share this post


Link to post
Share on other sites
Well needless to say once I caught the mistake I reloaded the module and reinstalled it. However I cannot get the other options to show up as far as "not showing" them.
Not having done step 3 and 4 in the readme.txt could also give this kind of problems.
Does the current version of the module require a different solution for this field length or has it been rectified?
No you still need to enlarge the field set_function to hold all the modules or remove some of the shipping methods (remove the ones not offered in your country I would say). You can find it as the last field in the table configuration. It is standard osC, no way you cannot have it. The line that was 291 went to somewhere around 385:

		// 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())");

Share this post


Link to post
Share on other sites

Everything seems to be working fine on this mod except when the total weight of all items is more than 150 lbs. it doesn't split them and UPS reports a weight limit restriction.

Share this post


Link to post
Share on other sites
Everything seems to be working fine on this mod except when the total weight of all items is more than 150 lbs. it doesn't split them and UPS reports a weight limit restriction.
Strange, checked this today setting dimensions support to '0', but in the "regular" UPS XML it works fine (and I can't think of a reason why this shouldn't work in the MVS version...)

Share this post


Link to post
Share on other sites

Can anyone say for certain that the full "UPSXML with full dimensional support" contrib will function fully with Canada Post 3_7 rev 1?

 

There is what seems to be tricky code integration. The last time I tried it, I messed it up. I had first installed Canada Post (worked great), then UPSXML with dimesions. Had to start the whole store over. (I backup now)

 

Is there a defined proceedure to installl both? Do I install one before the other? Do I leave out a piece of code?

 

I have the UPSXML without dimensional installed right now and it seems to be working fine. I will now install the Canada Post contrib as well to see how it goes. (Of course I will do a full backup before hand).

 

My store is in Ontario Canada and I will be shipping to clients in Canada and USA. Most of my products are hefty (fluid filled 5 gal pails at 45 to 50 lbs each) and ship in their own packaging. There are some boxed items as well, but the the variety is small. Some large freight shipping will be done through the already installed Fedex Freight module. I also have everything set up with Canada Post and UPS (including key).

 

Any advice????

 

I will hold off installing the UPSXML Dimesional support for now. :blush:


I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Share this post


Link to post
Share on other sites
Can anyone say for certain that the full "UPSXML with full dimensional support" contrib will function fully with Canada Post 3_7 rev 1?

 

There is what seems to be tricky code integration. The last time I tried it, I messed it up. I had first installed Canada Post (worked great), then UPSXML with dimesions. Had to start the whole store over. (I backup now)

 

Is there a defined proceedure to installl both? Do I install one before the other? Do I leave out a piece of code?

I don't see the problem. If you already have Canada post installed, you only need to run the sql for the table packaging:

DROP TABLE IF EXISTS packaging;
CREATE TABLE packaging (
 package_id int NOT NULL auto_increment,
 package_name varchar(64) NOT NULL,
 package_description varchar(255) NOT NULL,
 package_length DECIMAL(6,2) default '5' NOT NULL,
 package_width DECIMAL(6,2) default '5' NOT NULL,
 package_height DECIMAL(6,2) default '5' NOT NULL,
 package_empty_weight DECIMAL(6,2) DEFAULT '0' NOT NULL,
 package_max_weight DECIMAL(6,2) DEFAULT '50' NOT NULL,
 package_cost int(5) NOT NULL,
 PRIMARY KEY (package_id)
);

The rest is already there. Make sure you don't mix and match the dimensions and weights, because UPS XML has it settings in the admin: so kilograms/centimeters or pounds/inches for weight/sizes. Then for UPS XML with dimensions you will have to install the admin part for editing packaging, but not for the products (because you already did that with Canada post).

 

The dimensions support works fair now, at least no missing items etc. Of course you can't expect it to be 100% on the mark always because it doesn't go back to see if it can stuff some small items in previous box if that is filled with a big product. But apart from that it works. Oh, read a few pages back, there is something missing in the shipping module upsxml.php for Canada (had to do with ...CODE_CANADA_ORIGIN_02, UPS Expedited)

Share this post


Link to post
Share on other sites

Thank very much.

 

You help alot by saying to add the Admin only and not the product portion. When I used the file compare program to add the code, I carefully examined each input and notice a few places where I would have screwed it up if I just hit the insert button. I copied and pasted carefully and they (CP and UPSXML) are both working together.

 

I have yet to insert the package dimension component into the database and examine the code changes for it, but not now, I have a store to put online.

 

Note:

UPSXML always returns rates that are higher (20% or so) than Fedex and Canada Post, all the time. Are they a more expensive shipper? Am I not set up right? :)


I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Share this post


Link to post
Share on other sites

I have installed the upsxml contribution on my site and it is not working. Everything seems to work on the admin side, but when the customer goes to checkout the generic "The page cannot be displayed" error page appears. When I set the enable ups shipping to false the page loads and operates properly. I dont know why this is happening since the contribution does not require any changes to checkout_shipping.php. Has anyone else had this problem? Any suggestions?

Share this post


Link to post
Share on other sites

JanZ I have all other issues worked in and out. Now I am starting to crack up on a new issue. The weights are coming up all wrong with dimensional support enabled. ie 2 lbs of cargo ends up as 7 lbs! :angry:

 

While scouring the code I have picked up on a few things:

in the top you will see this

	var $code, $title, $description, $icon, $enabled, $types, $boxcount;

No where in the whole of osCommerce do I see $types except for the shipping mods and then only in the var section of those code pages. I think this is supposed to be $package_types or it needs to be removed.

 

Another is the $boxcount it is seen twice in upsxml.php once in the var initation line and again in the global setting line (inside the function quote) everywhere else anything resembling boxcount is seen it is written as boxCount I'm assuming typo here and found it easier to change it in the the two lines var and global.

 

 

Even with these changes I am still getting inaccurate quotes. Wrong number of boxes and the wrong weight.

 

And all my admin settings for tare weight etc are set to zero.

Edited by HallMarc

Share this post


Link to post
Share on other sites

OK JanZ I hope you can point me in the right direction now. After some further study I have found that the dimensional calculator keeps pulling a box with a 64 inch length even though I only have two items with a 12 x 12 x 12 each so no matter how you stack them they should only 24 x 12 x 12.

 

Any idea where I may have screwed something up or is this something that is wrong with the packaging alg?

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

×