Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New UPS XML Shipping Module available


Recommended Posts

Stupid editor

 

 

One more thing

24 * 12 * 12 = 3456

64 * 9 * 6 = yup you guessed it 3456!

Is this the only box that matches the cubic volume?

Link to comment
Share on other sites

OK I have figured out how to get accurate enough quotes using dimensional suport to call this contribution almost gamma. All I ended up changing was the order by statement in the packaging query from volume to package_id. For those of you that I just lost, it goes like this, I was getting whacked out quotes from UPS because this contrib always chose the longest box to pack thing's in which caused UPS to send back qoutes for OVERSIZED packages. Once I changed the order by parameter it started choosing boxes that made more sense. Still not perfect but better by far.

 

JanZ I also found out that the weight problem was being caused by the packaging info. I don't know who set those weights for empty boxes but Jeesh! give us a break will ya! :blink:

 

This is the line of code that I am referring to:

		$packages_query = tep_db_query("select *, (package_length * package_width * package_height) as volume from " . TABLE_PACKAGING . " order by volume;");

 

I changed it to this:

		$packages_query = tep_db_query("select *, (package_length * package_width * package_height) as volume from " . TABLE_PACKAGING . " order by package_id;");

I am now resetting all info in the packaging table to more realistic weights and costs and then I want to make it so the packaging info can also be vendor specific.

Link to comment
Share on other sites

Thanks for this great contribution!

 

I have it installed and it works well but i cannot remove Next Day Early AM option

 

I deleted it out of catalog/includes/modules/shipping/upsxml.php from line 365 but it still shows up.

 

Please help

Link to comment
Share on other sites

I changed it to this:

		$packages_query = tep_db_query("select *, (package_length * package_width * package_height) as volume from " . TABLE_PACKAGING . " order by package_id;");

I am now resetting all info in the packaging table to more realistic weights and costs and then I want to make it so the packaging info can also be vendor specific.

Wouldn't it not be more logical to use "order by package_cost" because that is a sort order you can change yourself. Having oversized boxes for UPSXML to choose from will result in them being used of course... Tough to avoid that I guess. You can't make those oversize items 'ready-to-ship' ?
Link to comment
Share on other sites

i cannot remove Next Day Early AM option

 

I deleted it out of catalog/includes/modules/shipping/upsxml.php from line 365 but it still shows up.

I don't know what line 365 contains but if it that was the line after:
// add key for disallowed shipping methods

then you just made sure you cannot exclude that method in the admin anymore. Removing those shipping methods is just a matter of checking some boxes in the admin....

Link to comment
Share on other sites

Wouldn't it not be more logical to use "order by package_cost" because that is a sort order you can change yourself. Having oversized boxes for UPSXML to choose from will result in them being used of course... Tough to avoid that I guess. You can't make those oversize items 'ready-to-ship' ?
I suppose I could try that and I don't see what it would hurt. BTW I had thought that these packing algorithms would start with the smallest packages and then work their way up.

 

Next I want to add a way for it to automatically split up the shipments into seperate (say 40lb, 100k) packages. ine isn't doing it right now. Is it supposed to?

Edited by HallMarc
Link to comment
Share on other sites

Has anybody had problems with SSL being enabled?

 

The log file is showing a cURL error when on my server when I enable SSL in my shop. Am working with my host, but I wanted to make sure it really is the server and not something else.

 

The message in the log file says a setting in cURL has "https" disabled, sound familiar to anyone?

 

Craig :)

Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: [email protected]

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Link to comment
Share on other sites

BTW I had thought that these packing algorithms would start with the smallest packages and then work their way up.
It does, because of the order by volume (default in MySQL is ascending (ASC), no need to explicitly add that).
Next I want to add a way for it to automatically split up the shipments into seperate (say 40lb, 100k) packages. ine isn't doing it right now. Is it supposed to?
Yes, absolutely.
Link to comment
Share on other sites

I'm getting this error on the shipping page:

 

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

 

Any idea why?

Link to comment
Share on other sites

It does, because of the order by volume (default in MySQL is ascending (ASC), no need to explicitly add that).

Yes, absolutely.

Jan, maybe that was the intention, however, before I changed the reference it was starting with the largest and then stopping when it found a perfect match by volume.

Link to comment
Share on other sites

I am new to the world of OsCommerce and have little to no programming knowledge, can anyone please give me a simple walkthrough to how I can install the UPS XML Module on my site?

 

 

Chris.

Edited by smartmovez
Link to comment
Share on other sites

Sorry if this has been answered, I couldn't find it. So, with this contribution it gives you rates tied to your UPS account but does NOT charge your account that amount?

 

Is this how it works for Drop Off?

*Customer places order and gets quote

*store owner takes item to UPS drop off location and mails item using his UPS account.

*his account is then charged

 

Or am I off?

Link to comment
Share on other sites

So, with this contribution it gives you rates tied to your UPS account but does NOT charge your account that amount?
Right, it only gives quotes.
Is this how it works for Drop Off?

*Customer places order and gets quote

*store owner takes item to UPS drop off location and mails item using his UPS account.

*his account is then charged

Yes, osC will not be involved in this other than giving the customer a quote (which is hopefully close to what UPS charges you when you drop the packaged order off).
Link to comment
Share on other sites

After the installation of the latest version, I activated it first, and then tried to edit it, I got an error:

 

Fatal error: Call to undefined function: tep_cfg_select_multioption() in /var/www/html/online/admin/modules.php(212) : eval()'d code on line 1

 

What does thisa mean? how to solve it, please help.

 

Thanks

Link to comment
Share on other sites

What does thisa mean? how to solve it, please help.
It means you didn't follow the instructions in the readme.txt and therefore did no do step 3 (or added it to that file in the catalog section, this is in the admin section).

 

Step 3 tells you to add the below lines with that function to admin/includes/functions/general.php:

// UPSXML
// Alias function for Store configuration values in the Administration Tool
 function tep_cfg_select_multioption($select_array, $key_value, $key = '') {
for ($i=0; $i<sizeof($select_array); $i++) {
  $name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
  $string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';
  $key_values = explode( ", ", $key_value);
  if ( in_array($select_array[$i], $key_values) ) $string .= ' CHECKED';
  $string .= '> ' . $select_array[$i];
} 
$string .= '<input type="hidden" name="' . $name . '" value="--none--">';
return $string;
 }

Link to comment
Share on other sites

I have Standard, Ground, express methods enabled, when I checked out, I got this:

 

UPS.jpg

 

Three questions:

 

1. How can I hide the weight with the red ciecle, 25lbs.

 

2. Why the UPS ground never shows up?

 

3. The Standard is cheaper than Ground? I thought the ground is the cheapest and slowest way. Am I right?

 

Thanks

Link to comment
Share on other sites

1. How can I hide the weight with the red ciecle, 25lbs.
Change the code in the function quote, these lines start somewhere around line 300 in catalog/includes/modules/shipping/upsxml.php:

			} else {
			$this->quotes = array('id' => $this->code, 'module' => $this->title . ' (' . $shipping_num_boxes . ($this->boxCount > 1 ? ' pkg(s) x ' : ' pkg x ') . round($shipping_weight,0) . ' ' . strtolower($this->unit_weight) . ' total)');

 

2. Why the UPS ground never shows up?
Because UPS Ground is a UPS shipping option only available in the US. The line of text missing is because of a missing line in the file catalog/includes/modules/shipping/upsxml.php for the Canadian origin (UPS Expedited, 02 in the definitions).

 

3. The Standard is cheaper than Ground? I thought the ground is the cheapest and slowest way. Am I right?
See question 2.
Link to comment
Share on other sites

Thanks for your time and great help, JanZ. I know how to hide it now.

 

a few more problems with me, if you can help, it will be greatly appreciated.

 

1. Always a wierd number displayed there, the circled one, it is even there when I only enable UPS standard, now I have Standard and express enabled.

 

UPS2.jpg

 

 

2. When checked out, the shipping charge won't add to the total(this is a out of province sale, GST only). Also, which code I should change to hide the weight on this page?

UPS3.jpg

 

 

3. When the sales is provincial, won't add the shipping charge either, but will display PST and GST twice.

this didn't happen before I installed the contribution, and it won't happen either if I disable this contribution now.

UPS4.jpg

Link to comment
Share on other sites

Great mod everyone.....but it has one HUGE problem when using dimensional support.

 

JanZ - this is what I had PMd you about - however, I though everyone may benefit from this.

 

Here is the scenario:

 

I have a shopping cart with qty of 100 items in it (same item). The stats of the item are such:

 

Weight: 0.80 lbs

3.5"(length) x 9.5"(width) x 9.5"(height)

 

Here is the XML Request being sent to UPS:

 

<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
  <AccessLicenseNumber>xxx</AccessLicenseNumber>
  <UserId>xxx</UserId>
  <Password>xxx</Password>
</AccessRequest>
<?xml version="1.0"?>
<RatingServiceSelectionRequest xml:lang="en-US">
  <Request>
   <TransactionReference>
	   <CustomerContext>Rating and Service</CustomerContext>
	   <XpciVersion>1.0001</XpciVersion>
   </TransactionReference>
   <RequestAction>Rate</RequestAction>
   <RequestOption>shop</RequestOption>
  </Request>
  <PickupType>
   <Code>01</Code>
  </PickupType>
  <Shipment>
   <Shipper>
	   <Address>
		   <City>Bolingbrook</City>
		   <StateProvinceCode>IL</StateProvinceCode>
		   <CountryCode>US</CountryCode>
		   <PostalCode>60490</PostalCode>
	   </Address>
   </Shipper>
   <ShipTo>
	   <Address>
		   <City>Bolingbrook</City>
		   <StateProvinceCode>IL</StateProvinceCode>
		   <CountryCode>US</CountryCode>
		   <PostalCode>60490</PostalCode>
<ResidentialAddressIndicator/>
	   </Address>
   </ShipTo>
   <Package>
	   <PackagingType>
		   <Code>02</Code>
	   </PackagingType>
	   <Dimensions>
		   <UnitOfMeasurement>
			   <Code>IN</Code>
		   </UnitOfMeasurement>
		   <Length>46.00</Length>
		   <Width>21.00</Width>
		   <Height>21.00</Height>
	   </Dimensions>
	   <PackageWeight>
		   <UnitOfMeasurement>
			   <Code>LBS</Code>
		   </UnitOfMeasurement>
		   <Weight>63.6</Weight>
	   </PackageWeight>
	   <PackageServiceOptions>
		   <InsuredValue>
			   <CurrencyCode>USD</CurrencyCode>
			   <MonetaryValue>100</MonetaryValue>
		   </InsuredValue>
	   </PackageServiceOptions>
   </Package>
   <Package>
	   <PackagingType>
		   <Code>02</Code>
	   </PackagingType>
	   <Dimensions>
		   <UnitOfMeasurement>
			   <Code>IN</Code>
		   </UnitOfMeasurement>
		   <Length>79.00</Length>
		   <Width>12.00</Width>
		   <Height>12.00</Height>
	   </Dimensions>
	   <PackageWeight>
		   <UnitOfMeasurement>
			   <Code>LBS</Code>
		   </UnitOfMeasurement>
		   <Weight>40.2</Weight>
	   </PackageWeight>
	   <PackageServiceOptions>
		   <InsuredValue>
			   <CurrencyCode>USD</CurrencyCode>
			   <MonetaryValue>100</MonetaryValue>
		   </InsuredValue>
	   </PackageServiceOptions>
   </Package>
  </Shipment>
  <CustomerClassification>
   <Code>01</Code>
  </CustomerClassification>
</RatingServiceSelectionRequest>

 

Here is the response from UPS:

 

<?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>03</Code></Service><RatedShipmentWarning>Oversize 2 indicator has automatically been set on Package 1.</RatedShipmentWarning><RatedShipmentWarning>Oversize 2 indicator has automatically been set on Package 2.

 

The mod doesn't handle the response properly, and comes back with this screen:

 

upserror.jpg

 

Now, we have a $2.00 handling fee. So, for whatever reason when this mod receives the above response from UPS, it calculates a "0 pkg" with the correct weight (104 lbs).....however it's coming up with a $3 + $2 handling charge quote....because, obviously, it received no quote from UPS. Also, it only comes up with "Ground" and none of the other options we've enabled.

 

In reality, this can be properly broken up into nine seperate 15lb packages, and that's what it should be sending to UPS in the request.

 

BTW - I have installed the 700+ pre-defined packages. Could the problem be there?

 

How can we correct this?

 

Any help would be GREATLY appreciated. Other than this bug, the dimensional support seems to be working fine.

 

Thanks!

 

-Paul

Edited by pyounan
Link to comment
Share on other sites

1. Always a wierd number displayed there, the circled one, it is even there when I only enable UPS standard, now I have Standard and express enabled.
You overlooked my answer to that, see above under 2 for the missing line (there is a link to a post describing what you need to do).
2. When checked out, the shipping charge won't add to the total(this is a out of province sale, GST only).
This is something outside UPSXML. All shipping modules have a standard method and standardized output to give the shipping methods back. This cannot have anything to do with UPS XML. You are familiar with the Canada Tax Zones Setup notes?
Also, which code I should change to hide the weight on this page?
IMO it gets this info from the lines of code I showed you above.
3. When the sales is provincial, won't add the shipping charge either, but will display PST and GST twice.

this didn't happen before I installed the contribution, and it won't happen either if I disable this contribution now.

Looks weird but as said it seems highly unlikely to me that this is due to UPS XML and I think it has everything to do with your tax setup.
Link to comment
Share on other sites

Paul,

Here is the scenario:

 

I have a shopping cart with qty of 100 items in it (same item). The stats of the item are such:

 

Weight: 0.80 lbs

3.5"(length) x 9.5"(width) x 9.5"(height)

 

Here is the XML Request being sent to UPS:

I have never looked at the 700+ pre-defined packages contribution because frankly I don't understand what it should do? If you let UPS XML use 700 different packaging cartons to choose from you run a serious chance of choking the whole packaging subroutine because it will loop through them so often (especially with 100 items) that I wouldn't be amazed at a time-out of PHP. And if you can enable a number of cartons, the ones you use for shipping, why do you need a contribution for that? You have scales and a ruler don't you?

 

Since the packaging routine will try to use the minimum number of packages it will use an oversize box if that is one available. It seems there are boxes sized 46 x 21 x 21 and 79 x 12 x 12 available. The packaging routine is not smart enough to avoid oversized boxes (for big, oversized items you should try to use "ready-to-ship").

 

Still I don't understand why the warning messages give this trouble. I have tried an oversized package that triggered a warning and that didn't trip anything (aside from the warning UPS also gave quotes). The xml document/subroutines that are in the class are incomprehensible to me, so I don't dare to try to fix anything in there in case that gives the trouble (actually I have my suspicions about it, when osC handles xml natively in the new version 3 I think that should be used instead). If that is the full response of UPS than obviously they opted not to give any quotes on the oversized packages (not my, very limited experience).

Link to comment
Share on other sites

OK all, here's how I corrected the problem (mostly):

 

(1) used Hallmarc's suggestion to change the "order by" from package_id to "volume" - see his message above.

 

(2) took out all the "Oversized" and "Envelope" pre-defined packages from the packaging contribution. Went down from 700+ package definitions to around 20, reasonably-sized packages. Nothing with a maximum weight of over 40lbs.

 

Now, the above scenario (with 100 items each being the same item with dimensions above) properly get put into seven 15-lb boxes.

 

Anywho, what is happening now is this:

 

If I have an item, say a plasma TV, that weighs 100 lbs and has the dimensions of:

 

<Length>48.00</Length>
<Width>18.00</Width>
<Height>37.50</Height>

 

...and have the "product ready to ship" flag set on it, the same exact thing happens.

 

UPS comes back with a "Oversize 3/Large Package" response.....and this mod still comes back with only a "Ground" rate at $2 handling plus what must be some default $3 rate.....for a total of $5.

 

Now, am I crazy or should this thing just simply refuse to return anything at all if it can't get a sane quote from UPS?

 

Why not just come back with nothing, rather than creating some crazy $3 quote?

Link to comment
Share on other sites

JanZ,

 

I agree with you....this has gotta be an XML parsing issue on the part of the mod. It seems to be not properly processing the entire XML response back from UPS. At least according to the log, the XML response seems to be severely truncated in these instances.

 

The only way to test for sure is to test the REQUEST/RESPONSE in a web browser to see what is really happening and what quote UPS is really trying to come back with.

 

I will let you all know.....

Link to comment
Share on other sites

Paul,

At least according to the log, the XML response seems to be severely truncated in these instances.
If what you posted was the complete response.... that's not valid xml.

 

The only way to test for sure is to test the REQUEST/RESPONSE in a web browser to see what is really happening and what quote UPS is really trying to come back with.
The log pretty well catches the whole response in my opinion. Using cURL will also show the headers, that is true.

 

You don't use the test server of UPS? Perhaps the production server gives different results....

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