Zen Cart Logo
Forums / Addon Shipping Modules / UPS XML: Support Thread

UPS XML: Support Thread

Views: 110,357

Results 201 to 220 of 246
11 Oct 2022, 4:50 PM
#201
spython avatar

spython

New Zenner

Join Date:
Jun 2016
Location:
New York, NY
Posts:
85
Plugin Contributions:
0

UPS XML: Support Thread

lat9:

Have you set your "UPS Rates: Shipper Number" so that you're receiving your store's negotiated rates?

@lat9 Thank you for your reply and your work on this module which is greatly appreciated. By "UPS Rates: Shipper Number" do you mean the Access Key? This is set. As is the username and password. I do not see a separate entry for Shipper Number in the UPSXML module. However, I do see this in my debug log:
#1 upsxml->__construct() called at [/admin/modules.php:204]
#2 require(/gpzhq/modules.php) called at [/admin/index.php:11]
--> PHP Warning: Use of undefined constant MODULE_SHIPPING_UPSXML_SHIPPER_NUMBER - assumed 'MODULE_SHIPPING_UPSXML_SHIPPER_NUMBER' (this will throw an Error in a future version of PHP) in /includes/modules/shipping/upsxml.php on line 92.

N.B. I have changed the name of our admin folder to its default in this quoted logfile

11 Oct 2022, 6:11 PM
#202
spython avatar

spython

New Zenner

Join Date:
Jun 2016
Location:
New York, NY
Posts:
85
Plugin Contributions:
0

Re: UPS XML: Support Thread

So this would seem to be the issue - there is no entry field showing in the upsxml module for Shipper Number - evidently because of the undefined constant error on line 92 of /includes/modules/shipping/upsxml.php ? I have double checked all the files in your package, upsxml-1.7.11.zip to ensure they are uploaded to the right directories. What could be causing this error? We are using PHP 7.2.0 which should be OK.

11 Oct 2022, 6:29 PM
#203
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,954
Plugin Contributions:
8

Re: UPS XML: Support Thread

SPython:

So this would seem to be the issue - there is no entry field showing in the upsxml module for Shipper Number - evidently because of the undefined constant error on line 92 of /includes/modules/shipping/upsxml.php ? I have double checked all the files in your package, upsxml-1.7.11.zip to ensure they are uploaded to the right directories. What could be causing this error? We are using PHP 7.2.0 which should be OK.

you need to re-install.

i would copy all of your config values, and then click remove the shipping module. and then install again.

that should hopefully fix the problem for your shipper number.

best.

11 Oct 2022, 7:21 PM
#204
spython avatar

spython

New Zenner

Join Date:
Jun 2016
Location:
New York, NY
Posts:
85
Plugin Contributions:
0

Re: UPS XML: Support Thread

carlwhat:

you need to re-install.

i would copy all of your config values, and then click remove the shipping module. and then install again.

that should hopefully fix the problem for your shipper number.

best.

@carlwhat Thank you. That did indeed fix the problem. When I upgraded the Zencart to 1.5.7d I should have removed the previous upsxml values from the database before proceeding. The new install did not have a upsxml module and I just went ahead and installed the newest version not realizing that it was pulling the values of the previous module from the database. Removing the module as you suggested and reinstalling presented all new fields including the entry for a shipping number. Now the module is pulling the correct rates. Thanks.

11 Oct 2022, 7:28 PM
#205
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,954
Plugin Contributions:
8

Re: UPS XML: Support Thread

SPython:

@carlwhat Thank you. That did indeed fix the problem. When I upgraded the Zencart to 1.5.7d I should have removed the previous upsxml values from the database before proceeding. The new install did not have a upsxml module and I just went ahead and installed the newest version not realizing that it was pulling the values of the previous module from the database. Removing the module as you suggested and reinstalling presented all new fields including the entry for a shipping number. Now the module is pulling the correct rates. Thanks.

:thumbsup:

14 Dec 2022, 9:59 AM
#206
numinix avatar

numinix

Totally Zenned

Join Date:
Apr 2007
Location:
Vancouver, Canada
Posts:
1,566
Plugin Contributions:
58

Re: UPS XML: Support Thread

Hi @lat9,
We appreciate your work on this module.
When we set DIMENSIONS_SUPPORTED to use, it is getting data from TABLE_PACKAGING.
But we cannot find SQL that includes TABLE_PACKAGING.
Can you please tell us which additional script or module needed for dimensional support? Thanks.

14 Dec 2022, 12:11 PM
#207
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: UPS XML: Support Thread

numinix:

Hi @lat9,
We appreciate your work on this module.
When we set DIMENSIONS_SUPPORTED to use, it is getting data from TABLE_PACKAGING.
But we cannot find SQL that includes TABLE_PACKAGING.
Can you please tell us which additional script or module needed for dimensional support? Thanks.
That 'DIMENSIONS_SUPPORTED' is, er, unsupported. It was present in the module when I assumed responsibility and have no idea what additional script/module is required.

I'll be removing that section totally for the next, forthcoming, release.

30 Jan 2023, 12:25 PM
#208
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: UPS XML: Support Thread

Version 1.8.0 of the UPS-XML shipping module is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=126

This release contains the following changes:

#29: Use zen_get_shipping_enabled when determining enabled status.
#30: Register all class variables, PHP 8.2 requirement.
#31: Remove the dimensional support — which doesn't work, anyway!
#32: Drop support for Zen Cart versions prior to 1.5.7a.

30 Jan 2023, 7:22 PM
#209
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: UPS XML: Support Thread

lat9:

Version 1.8.0 of the UPS-XML shipping module is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=126

This release contains the following changes:

#29: Use zen_get_shipping_enabled when determining enabled status.
#30: Register all class variables, PHP 8.2 requirement.
#31: Remove the dimensional support — which doesn't work, anyway!
#32: Drop support for Zen Cart versions prior to 1.5.7a.

NOTE! Version 1.8.1 now released; v1.8.0 caused error with OPC; use 1.8.1 instead!

3 Feb 2023, 8:59 PM
#210
chadlly2003 avatar

chadlly2003

Totally Zenned

Join Date:
Jan 2015
Posts:
741
Plugin Contributions:
0

Re: UPS XML: Support Thread

version 1.8.1
zencart 1.5.8

I installed the module and seem to be getting some errors. If someone could assist me that would be great

[03-Feb-2023 15:50:04 America/New_York] Request URI: /invertersupply.com/index.php?main_page=checkout, IP address: 127.0.0.1
#0 C:\xampp\htdocs\xxx.com/includes\modules\shipping\upsxml.php(427): zen_debug_error_handler()
#1 C:\xampp\htdocs\xxx.com/includes\classes\shipping.php(201): upsxml->quote()
#2 C:\xampp\htdocs\xxx.com/includes\modules\pages\checkout\header_php.php(172): shipping->quote()
#3 C:\xampp\htdocs\xxx.com/index.php(41): require('C:\\xampp\\htdocs...')
--> PHP Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\xxx.com/includes\modules\shipping\upsxml.php on line 427.

line 427

$state = zen_get_zone_code($order->delivery['country']['id'], (int)$order->delivery['zone_id'], '');
        $this->_upsOrigin(MODULE_SHIPPING_UPSXML_RATES_CITY, MODULE_SHIPPING_UPSXML_RATES_STATEPROV, MODULE_SHIPPING_UPSXML_RATES_COUNTRY, MODULE_SHIPPING_UPSXML_RATES_POSTALCODE);

error2

[03-Feb-2023 15:50:04 America/New_York] PHP Fatal error:  Uncaught TypeError: zen_get_zone_code(): Argument #1 ($country_id) must be of type int, null given, called in C:\xampp\htdocs\xxx.com/includes\modules\shipping\upsxml.php on line 427 and defined in C:\xampp\htdocs\xxx.com/includes\functions\functions_addresses.php:173
Stack trace:
#0 C:\xampp\htdocs\xxx.com/includes\modules\shipping\upsxml.php(427): zen_get_zone_code(NULL, 0, '')
#1 C:\xampp\htdocs\xxx.com/includes\classes\shipping.php(201): upsxml->quote('')
#2 C:\xampp\htdocs\xxx.com/includes\modules\pages\checkout\header_php.php(172): shipping->quote()
#3 C:\xampp\htdocs\xxx.com/index.php(41): require('C:\\xampp\\htdocs...')
#4 {main}


  thrown in C:\xampp\htdocs\xxx.com/includes\functions\functions_addresses.php on line 173

[03-Feb-2023 15:50:04 America/New_York] Request URI: /invertersupply.com/index.php?main_page=checkout, IP address: 127.0.0.1
--> PHP Fatal error: Uncaught TypeError: zen_get_zone_code(): Argument #1 ($country_id) must be of type int, null given, called in C:\xampp\htdocs\xxx.com/includes\modules\shipping\upsxml.php on line 427 and defined in C:\xampp\htdocs\xxx.com/includes\functions\functions_addresses.php:173
Stack trace:
#0 C:\xampp\htdocs\xxx.com/includes\modules\shipping\upsxml.php(427): zen_get_zone_code(NULL, 0, '')
#1 C:\xampp\htdocs\xxx.com/includes\classes\shipping.php(201): upsxml->quote('')
#2 C:\xampp\htdocs\xxx.com/includes\modules\pages\checkout\header_php.php(172): shipping->quote()
#3 C:\xampp\htdocs\xxx.com/index.php(41): require('C:\\xampp\\htdocs...')
#4 {main}
  thrown in C:\xampp\htdocs\xxx.com/includes\functions\functions_addresses.php on line 173.

line 173

function zen_get_zone_code(int $country_id, int $zone_id, string $default_zone = '')
{
    global $db;
    $sql = "SELECT zone_code
            FROM " . TABLE_ZONES . "
            WHERE zone_country_id = " . (int)$country_id . "
            AND zone_id = " . (int)$zone_id;

    $result = $db->Execute($sql);

    if ($result->RecordCount() > 0) {
        return $result->fields['zone_code'];
    }
    return $default_zone;
}
3 Feb 2023, 10:00 PM
#211
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: UPS XML: Support Thread

Have you tried this with the in-core 3-page checkout? I'm unclear as to what checkout process you're using, but I don't recognize a **checkout **page and I'm guessing that that's where you're running into problems:

[03-Feb-2023 15:50:04 America/New_York] Request URI: /invertersupply.com/index.php?main_page=checkout, IP address: 127.0.0.1

3 Feb 2023, 10:30 PM
#212
chadlly2003 avatar

chadlly2003

Totally Zenned

Join Date:
Jan 2015
Posts:
741
Plugin Contributions:
0

Re: UPS XML: Support Thread

yes in the checkout page is when the error occurs.

I am currently using numinix fast and easy checkout

3 Feb 2023, 11:12 PM
#213
chadlly2003 avatar

chadlly2003

Totally Zenned

Join Date:
Jan 2015
Posts:
741
Plugin Contributions:
0

Re: UPS XML: Support Thread

my link looks like this at the checkout

main_page=checkout&fecaction=null

3 Feb 2023, 11:34 PM
#214
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: UPS XML: Support Thread

chadlly2003:

my link looks like this at the checkout

main_page=checkout&fecaction=null
I've got no access to a site running that checkout processing. Given that UPS-XML runs fine under zc157 and zc157 under OPC and the standard 3-page checkout, I'll suggest that you start looking in Numinix's code for the source of the issue.

For whatever reason, the $order class' delivery section is malformed when presented to UPS-XML; the order's delivery['country']['id'] is not set/null when the shipping method is invoked.

$state = zen_get_zone_code($order->delivery['country']['id'], (int)$order->delivery['zone_id'], '');

11 Feb 2023, 9:13 PM
#215
split63 avatar

split63

Totally Zenned

Join Date:
May 2010
Location:
Texas
Posts:
513
Plugin Contributions:
0

Re: UPS XML: Support Thread

.
UPS has 7 "Worldwide" services, but only 3 are listed in this module. The one I wanted, "Worldwide Saver", is not listed.

Is the required "Shipper Number" the 6-digit UPS account number?

Where does the estimated shipping time come from, for example, real-time from UPS, or hard coded in the .php file?

Shipping Delay
How many days from when an order is placed to when you ship it
This depends on the day of the week. We ship only Monday, Wednesday and Friday. I guess we will enter 2 to be safe

12 Feb 2023, 1:51 PM
#216
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: UPS XML: Support Thread

split63:

.
UPS has 7 "Worldwide" services, but only 3 are listed in this module. The one I wanted, "Worldwide Saver", is not listed.

Is the required "Shipper Number" the 6-digit UPS account number?

Where does the estimated shipping time come from, for example, real-time from UPS, or hard coded in the .php file?

This depends on the day of the week. We ship only Monday, Wednesday and Friday. I guess we will enter 2 to be safe
For whatever reason, the "Worldwide Saver" is displayed as "Express Saver".

The "Shipper Number" (optional) is a 6-*character *value that you'll need to get your account's negotiated rates.

The ETA information is sent by the response from UPS.

14 Feb 2023, 7:51 PM
#217
spython avatar

spython

New Zenner

Join Date:
Jun 2016
Location:
New York, NY
Posts:
85
Plugin Contributions:
0

Re: UPS XML: Support Thread

I have installed UPSXML module 1.8.1 hoping that it would resolve a frequent intermittent problem. It did not. We are using Zencart 1.5.7d. The problem is that the UPS estimated charges do not always appear at customer checkout. Instead there are the following two lines (note the colon):
:
If you prefer to use ups as your shipping method, please contact ***. via Email.
When the charges do appear as expected and the user then returns to their cart to change the order - the charges do not appear below the UPS header and this "Error Your available shipping options have changed. Please re-select your desired shipping method" appears at the top of the page.
Additionally, when this occurs the following appears in the logs:
PHP Notice: Malformed value for session-based shipping module; customer will need to re-select: false in /includes/classes/order.php on line 326
Any help would be appreciated.
Thanks

14 Feb 2023, 8:13 PM
#218
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: UPS XML: Support Thread

SPython:

I have installed UPSXML module 1.8.1 hoping that it would resolve a frequent intermittent problem. It did not. We are using Zencart 1.5.7d. The problem is that the UPS estimated charges do not always appear at customer checkout. Instead there are the following two lines (note the colon):
:
If you prefer to use ups as your shipping method, please contact ***. via Email.
When the charges do appear as expected and the user then returns to their cart to change the order - the charges do not appear below the UPS header and this "Error Your available shipping options have changed. Please re-select your desired shipping method" appears at the top of the page.
Additionally, when this occurs the following appears in the logs:
PHP Notice: Malformed value for session-based shipping module; customer will need to re-select: false in /includes/classes/order.php on line 326
Any help would be appreciated.
Thanks
I'll need to see if I can reproduce the issue; if I can't determine the root-cause of the issue, I'm not able to provide a solution.

If this happens often enough, I'll suggest enabling the UPS-XML debug logs so that I could 'see' what communication happened between Zen Cart and the UPS API to cause the issue.

14 Feb 2023, 8:25 PM
#219
spython avatar

spython

New Zenner

Join Date:
Jun 2016
Location:
New York, NY
Posts:
85
Plugin Contributions:
0

Re: UPS XML: Support Thread

I am seeing this in the ups-xml debug log:
Error from cURL: Error [6]: Could not resolve host: onlinetools.ups.com
UPS RESPONSE:

14 Feb 2023, 8:43 PM
#220
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: UPS XML: Support Thread

SPython:

I am seeing this in the ups-xml debug log:
Error from cURL: Error [6]: Could not resolve host: onlinetools.ups.com
UPS RESPONSE:
CURL error 6, as the message indicates, is received when there's a DNS-lookup error for the given host -- in this case the onlinetools.ups.com site.

What company do you use for your webhost and what PHP version are you running on?

Note also that the Zen Cart distribution comes with a tool (/extras/curltester.php) that you can use to see if your site can access various sites (UPS, USPS and PayPal for instance). It'd be interesting to see the screen output from a 'run' on your site.