3rd party contributions - Shipping Modules - UPS XML
Original Copyright (c) 2003 Torin Walker
Insurance Support 2005 Joe McFrederick
Modifyed for Zen Cart™ by Dennis Sayer
This module provides the Zen Cart™ community with the XML version of the UPS Rates and Services gatway. It supports multiple languages, multiple geographic origins, and implements the most necessary features offered by the UPS Rates and Services system. The module connects to UPS and retrieves a list of available shipping methods and prices and presents them to the user.
The advantage of this module over the stock Zen Cart™ UPS module is it supports the Delivery Area Surcharge for Destination ZIP Codes Requiring A Surcharge. The down side is you will need to Register at UPS for an account and get a UPS Rates XML Access Key. This version does not have Dimensional support.
The contribution is located here.
UPS XML Rates v1.2.5d for zen-cart 1.2.5d
Original Copyright (c) 2003 Torin Walker, firstname.lastname@example.org
Insurance Support 2005 Joe McFrederick, email@example.com
Modified for Zen Cart™ 1.2.5d by Dennis Sayer - July 9, 2005, firstname.lastname@example.org
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, you may obtain one by writing to and requesting one from:
The Free Software Foundation, Inc.,
59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
Updated/modified/repackaged for osCommerce 2.2 MS2 by Stuart Owens 11/14/04
Time in Transit fixed by Greg MacLellan 11/15/04
A few bugfixes and installation added to upsxml.php JanZ 11/27/04 (1.1.3)
Bugfix for ship in cart: Jackie Edwards (1.1.3a)
More options for cURL (CLI support added and logging of cURL errors) JanZ 12/18/04 (1.1.4)
Updated/modified/repackaged for Zen Cart™ 1.2.5d by Dennis Sayer 07/09/2005
Thanks to the many other authors who laid down their efforts in contributions from which has produced this. Your efforts are greatly appreciated.
Original Contribution and updates - Torin Walker
Time In Transit capability - Donna Gordon
Bug fixes - Fox Morrey
Admin selectable methods and bug fixes - Jan Zonjee/Stuart Owens
Modifyed for Zen Cart™ 1.2.5d by Dennis Sayer
Tested for Zen Cart™ 1.3+ by Dennis Sayer
A note from Dennis Sayer
Thank you to Torin Walker for giving this code a GNU General Public License. I have removed your comments to web sites that no longer exist. I have also changed or deleted text that is not related to Zen Cart™.
This module provides the eCommerce Zen Cart™ community with the long-awaited XML version of the UPS Rates and Services gatway. It supports mutliple (customer facing) languages, multiple geographic origins, and implements the most necessary features offered by the UPS Rates and Services system. The module connects to UPS and retrieves a list of available shipping methods and prices and presents them to the user.
Settings are changed in the admin interface under Admin->Modules->Shipping->United Parcel Service (upsxml)
Packaging Not supported for Zen Cart™ as of July 9 2005 (DSS)
Admin > Tools > Packaging (if dimensional support is enabled)
Packaging Not supported for Zen Cart™ as of July 9 2005 (DSS)
The administrative interface shows shipper (not customer) related variables such as package type and origin in English, but customer-facing product names (the name UPS uses to describe its services, such as Express Plus, and Next Day A.M. can be multi-lingual.
Backup your database and all files that that are related to your store.
Change any folder names in the UPSXML_v1.2.5d extraction to meet the folder structure on your site. The usual changes are admin and catalog. Changing the admin folder name is a Zen Cart™ recommendation for increased security.
The files needed are:
catalog/admin/includes/classes/xmldocument.php catalog/includes/classes/xmldocument.php catalog/includes/languages/english/modules/shipping/upsxml.php catalog/includes/modules/shipping/upsxml.php
If you have all three of these:
UPS Rates account username UPS Rates account password UPS Rates Access Key
then go to STEP 4.
- Register at UPS for an account (https://www.ups.com/myups/registration)
- Goto Business Technology Solutions (http://www.ups.com/content/us/en/bussol/offering/technology/automated_shipping/online_tools.html)
- Click on Get OnLine Tools
- Click on UPS Rates & Service Selection
- Follow the UPS web site instructions to Get a License
- Download the Download UPS Rates & Service Selection Documentation if you choose to.
- Click on XML Access Key
- Enter yor Developer's Key (if you don't have one, Click on register)
- Write down your XML Access Key
In Admin, choose Modules > Shipping, and activate the new United Parcel Service (upsxml) module.
Edit the module and set your service options:
- UPS Rates Access Key (obtain from UPS)
- UPS Rates account username (obtain from UPS)
- UPS Rates account password (obtain from UPS)
- Pickup method
- Packaging Type
- Customer Classification Code
- Shipping Origin (determines what products names are shown based on origin)
- Origin City (required for some countries)
- Origin State/Province (two letter ISO 3166 code)
- Origin Country (two letter ISO 3166 code)
- Origin Zip/Postal Code
- Test or Production mode
- Unit Weight
- Unit Length
- Quote Type
- Handling Fee
- Tax Class
- Shipping Zone
- Sort Order
- Shipping Methods
- Shipping Delay
If you have any questions regarding the above settings, please refer to the documentation provided to you by UPS when you signed up for and received your access key.
Test by setting your customer destination to all sorts of different places, and running through the shipping process several times. Please test thoroughly before committing to its use.
If you fail to get quotes, an error message will usually tell you why. Make sure your origin information is correct, and use the proper two-letter codes for your country and state/province.
If you still don't get any quotes, you can enable logging which will record the request/response of the transactions and any cURL errors. Look for, uncomment, and change (e.g. to a full path) the line in upsxml.php (line 93):
To enable logging, create an empty upsxml.log file at the location you set below, give it write permissions (777) and uncomment the next line. Look at line 39 in the file at catalog\includes\configure.php to complete <YourServerDirectory>.
$this->logfile = '/<YourServerDirectory>/includes/modules/shipping/upsxml.log';
example of a full path:
Change the location of the log to something you can read (don't forget to give the file write permissions 777), create an empty file upsxml.log on that location, and give the shopping cart a whirl. Your request/response will eventually show up there.
If cURL is not compiled into PHP (Windows users and some Linux users) you can change line 94 to:
$this->use_exec = '1';
Using exec() cURL from the command line interface (CLI) is then used. If exec() is disabled and logging is enabled, this will be logged also.