Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New UPS XML Shipping Module available


Recommended Posts

I have just released my own version of the UPS XML Rates and Services Shipping Module. I wanted to release it early to get feedback and bug reports. I dare say I have not tested it on any system but my own, so please consider it very beta.

 

I plan on improving this by extending it to support the more obscure features of the UPS XML gateway, and introduce intelligent product packing for anyone who has installed Tom Croix's Canada Post 3.1 module with dimensional support.

 

Enjoy.

 

 

Torin...

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:

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

Pickup Method

Customer Counter

 

Packaging Type

Customer Package

 

Customer Classification Code

03

 

 

Origin Zip/Postal Code

95118

 

Test or Production Mode

Test

 

Quote Type

Residential

 

Handling Fee

 

 

etc.

 

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

A handling fee of $10.00 does not seem to show up at all.

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

Link to comment
Share on other sites

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_set_object(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer.

 

Does this mean my hosting will not support xml..?

Link to comment
Share on other sites

Guys,

 

I've found a few problems in the UPS XML module that I am addressing. I will release a fix very soon.

 

Are any of you guys using the DIMENSIONS support? This upcoming release will provide an admin interface and package configuration screen (allows you to configure shipping boxes, dimensions, weights) and the shipping module will use a simple box packing algorithm to fit your products into the least number of boxes. The quote is then based on the number of boxes, rather than the number of products you're selling.

 

Is there any interest in this kind of featureset, or should I publish the UPS XML Module with the option to turn it on/off? Making this an option will take considerably longer.

 

 

Torin...

Link to comment
Share on other sites

Torin;

 

First, thank you for your efforts in creating this mod. Shipping variations and expense are probably one of the most critical issues that an online seller faces, judging from the number of "how much is the shipping" questions that I receive.

 

While what I propose below goes beyond the scope of UPS shipping alone, a big part of it relies on UPS*** so, hopefully, it will be of value in this discussion and something that would be considered useful to a wide range of osC users. I identify specific shipping methods below just for illustration, but the ideal arrangement would probably allow for any shipping method set up in a shop. For the example below, we are using UPS, USPS, Special Handling (for items larger or heavier than what the previous 2 allow) and In-Store pickup. The origin of shipments is within the continental US.

 

1) Shipping methods available selectable on a per item basis in the product addition area of Admin.

2) Provisions for entering dimensions (length, width, height) of a product package on a per item basis, as above. It might be appropriate to simply dictate that entering dimensions for a product would dictate that product be treated as a separate package, which would eliminate the need for #3 below.

3) Switch to indicate whether an item should be treated as a separate package when added to a cart.

4) ***UPS and USPS Dimensional Weight, Oversize 1 and Oversize 2 calculations should be considered where they apply to a given service. These vary by service company, type of service and destination, so that should be reflected when a shipping destination is chosen and the resulting rates shown to the customer should reflect only what is valid for their order and shipping destination.

5) The "Ship In Cart" contribution should also reflect the results.

6) If mixed items within a cart dictate separate packages, the results should show "Package 1", "Package 2", etc. and be added to the order total accordingly.

7) If conditions for #6 exist, a user configurable message should appear at the top of the shipping quotes, such as: "Some of the products in your cart require specific shipping methods. If we can combine packages to lower your shipping costs, we will do so and advise you of the changes."

 

I realize that the above may not be completely thought out and there are probably considerations that I haven't addressed. Furthermore, I am not a programmer, so what I propose may not be doable and is definitely WAY beyond my meager skills, but I am hoping that it may tickle the creative in someone here who is capable of programming something like this and sees it as a need that many shops might have.

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

Mugitty,

 

Thank you for your input. I'm hoping to address as many issues as possible with this UPS module, not so much with the module itself, but with surrounding support (perhaps in the form of other modules upon which the UPS module depends) in order to improve the overall osCommerce payment and shipping systems. So far, I can see it breaking down into at least three separate modules:

 

A dimensional support module (adds LWH and Ready To Ship to products, plus a global dimensions switch - more on this in a moment)

The UPS XML module with Intellipak®

A packaging admin module - Packaging administration and library support - if this module is installed, other shipping modules can avail themselves of its packing algorithms.

 

The trick is convincing everyone that shipping matters this much!

 

Pertaining to your suggestions, the items I have successfully addressed so far are:

 

2) Provisions for entering dimensions (length, width, height) of a product package on a per item basis, as above.

 

3) Switch to indicate whether an item should be treated as a separate package when added to a cart.

 

Item (3) is treated with a "Ready To Ship" switch indicating the product is already boxed and ready to ship. It is simply added to the total number of boxes.

 

As for the remaining items (1, 4, 5, and 6), my module only optimizes to reduce the total number of packages but could be modified to quote against all the available shipping methods and return the lowest combination of shipping methods that both satisfy a lowest cost criteron and any shipping constraints set by the admin or inherent in the products purchased (such as permitting packages to ship separately, or oversize).

 

Perhaps you could provide me with an example of a customer purchasing two items and having each sent by a different courier. I personally would prefer to have everything arrive at the same time, and by the same service.

 

 

Torin...

Link to comment
Share on other sites

Frank,

 

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

[snip]

A handling fee of $10.00 does not seem to show up at all.

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.

 

Let me look into the handling fee. As far as the rate doubling and shipping screen showing up again, enable logging and take a look at the XML response from UPS. It might be throwing an error that I failed to catch.

 

 

Torin...

Link to comment
Share on other sites

Torin;

 

Perhaps you could provide me with an example of a customer purchasing two items and having each sent by a different courier. I personally would prefer to have everything arrive at the same time, and by the same service.

 

I agree, and usually, this is possible but here are a few examples that come to mind:

 

1) Cart contents

Engine short block - 50 pounds

Repair manual and extra air filters

 

This can all go UPS Ground, but the short block is being drop-shipped from the distributor* and the remaining items being sent from our store, with USPS Priority Mail being the most economical means (* I won't even get into the differences created by a separate originating ZIP code - this is a situation where I think I just have to live with the differences because I can't think of any way one could have the cart accomodate these variations within a given customer's shopping cart - luckily, in our case, the distributor's location is generally near enough to us that the differences are minimal).

 

2) Cart contents

String trimmer - 12 pounds, dimensions 60 x 10 x 10

Leaf blower - 18 pounds, dimensions 24 x 24 x 20

 

Again, all can go UPS Ground, but the first item falls into the Oversize 1 category (billable shipping weight 30 lbs.), while the second doesn't. They are both ready-to-ship packages and nothing would be gained by trying to ship both in one package (plus it would probably exceed the maximum per package size if they were combined).

 

Then there are the considerations for shipments that need to be Oversize rated if going UPS Ground or UPS Standard to Canada, but need to be Dimensional rated if going Second day air or Next day air.

 

There are a 'ton' of possible variations of course, and I don't believe that any system could deal with all of them dynamically (although I dream of someone proving me wrong), but I am in total agreement with you as to the need for something that would address as many of these issues as possible, thus reducing the "special handling" situations to a minimum.

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

Stuart,

 

I can see a few possible simple solutions, but we're treading into Enterprise grade shipping solutions here. Unfortunately, I don't have the time to develop such an elaborate system unless a) My business needs it; and B) My business earns enough to cover what I would lose by not working full time at a real job ;-), or, c) The osCommerce community all gather together and chip in to have me develop it for them.

 

Perhaps one day, when my business requires it, I will spend more time on developing a more elaborate system. Right now, I'm trying to contend with the existing issues of supposedly drop-in shipping modules! Not one is!

 

The Canada Post 3.1 module I had installed adds an extra 3 kg to the shipping cost for no apparent reason. Just the way the guy laid out his variables. I've fixed it in mine (since I derived code from his), but now I've got to go and fix his module as well. Good lord...

 

Anyway, I can see one quick fix that would require little more than a week's worth of evening-in-front-of-the-tv programming effort:

 

here are a few examples that come to mind:

 

1) Cart contents

Engine short block - 50 pounds

Repair manual and extra air filters

 

This can all go UPS Ground, but the short block is being drop-shipped from the distributor*

 

This could be done easily with multiple shipping locations. Since I am now proficient with developing admin interfaces for osCommerce, I could see a shipping origin configuration utility and product modification whereby one can choose from which location the product ships. I wouldn't want to keep it that simple however... I would want this module customizable, and intelligent. I would want to be able to configure a product such that it ships from the nearest location, and it would necessarily have to update the stock at that location. Every time you consider an option, another option pops up. Feature Creep will get ya.

 

 

2) Cart contents

String trimmer - 12 pounds, dimensions 60 x 10 x 10

Leaf blower - 18 pounds, dimensions 24 x 24 x 20

 

Again, all can go UPS Ground, but the first item falls into the Oversize 1 category (billable shipping weight 30 lbs.), while the second doesn't.

 

I wouldn't want to package these together. I just set the flag READY_TO_SHIP so the shipping module will treat the item as a box ready for shipping rather than a product that needs to be packed. I then send out the list of boxes to UPS for quotation.

 

As far as the oversize option goes, I can support it one of two ways: Program in every location on earth along with the corresponding maximum dimensions (UPS has a table for this), or allow the customer to specify what oversize means. The latter seems far simpler.

 

If the package exceeds the admin-defined dimensions and/or weight, an oversize=1 (or 2, or 3...) is added to the XML request for that package.

 

I'll take a look and see if I can quickly implement oversize.

 

Then there are the considerations for shipments that need to be Oversize rated if going UPS Ground or UPS Standard to Canada, but need to be Dimensional rated if going Second day air or Next day air.

 

See, this is where I let the UPS do most of the work. Their XML gateway is smart enough, provided I've submitted dimensions and specific locations, to adjust the cost according to any oversize requirements. That is, if I ship a package of 60x30x30 from the US to Canada, the XML gateway should adjust the rate according to the oversize requirement you just mentioned, and quote it accordingly.

 

I seem to get more accurate quotes when I provide extended details. Earlier modules (UPS Choices 1.7) only used zip and weight. I use City, Province/State, Country, and Postalcode/Zip, plus Length, Width, Height and Weight.

 

What has been your experience with the existing shipping modules? I haven't really tested any others because I've got my head buried in code. From the looks of it though, both the Canada Post 3.1 and the UPS Choices 1.7 module seem to treat quotations weirdly:

 

UPS Choices 1.7 uses the weight provided by osCommerce (which is correct) and multiplies the rate by the number of boxes (shipping tare weight / product weight - which is wrong)

 

The Canada Post module is just as bad. This one submits all the products and their quantities to Canada Post and lets them figure out how many boxes to use, but then returns a rate multiplied by the number of boxes provided initially by osCommerce, not Canada post.

 

I'm not sure why they work the way they do, or how they might be working for their authors...

 

 

Torin...

Link to comment
Share on other sites

Whizzkidd: You'll need to go to UPS to apply for a Developers' Key.. after that, you can request an Access Key.. the rest 'should' be automatic.. (I think).. mine's not working quite right.. :?

Link to comment
Share on other sites

I'm getting...

 

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of fsockopen(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in catalog/includes/modules/shipping/upsxml.php on line 431

 

Thomas

Link to comment
Share on other sites

Guys,

 

Re: Deprecated pass-by-reference error:

 

Just remove the _sendToHost function call. It's old code from the UPS Choices 1.7 module and is has been superceded by the _post method.

 

Thanks for pointing this out. I'll remove the method from the new release.

 

 

Torin...

Link to comment
Share on other sites

Great module thus far, really easy to implament. I am having a small problem though, after install, and then running through a test I get the following error. I've not dug around too much, but thought you may have seen this in the past. I'm running this within a test environment.

 

 

Fatal error: Call to undefined function: curl_init() in /home/staging/XXXXXX/public_html/oscommerce-2.2ms1/catalog/includes/modules/shipping/upsxml.php on line 587

 

Thanks in advance

-Murray

Link to comment
Share on other sites

I think you need hosting that support curl; if you run your own server, you can install it.. if you don't let me know, and I can provide ssl hosting that does..

Link to comment
Share on other sites

Thomas,

 

Thanks, I just went into the code, and could see what it was doing. Maybe I should have read the error message.. I run my own servers, so it's time to do some installs. Thanks for the help!

 

-Murray

Link to comment
Share on other sites

Hello,

 

I have some questions to this contribution:

 

1. Is it also applicable for UPS Germany, i.e. shop is located in Germany?

 

2. Does it handle the "outside areas" (areas which are hard to reach and therefore cost additional shipping)?

 

3. Does it handle dimensional weight (volume weight)?

 

4. Does it handle additional services (e.g. insurance...)?

 

5. Is it implemented with the zones module or is it an entire separate modul?

 

Thanks in advance for your answer.

 

Albert Kastl

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