Re: UPS XML: Support Thread
Quote:
Originally Posted by
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
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.
Re: UPS XML: Support Thread
Quote:
Originally Posted by
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.
Re: UPS XML: Support Thread
Quote:
Originally Posted by
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.
Re: UPS XML: Support Thread
Quote:
Originally Posted by
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:
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.
Re: UPS XML: Support Thread
Quote:
Originally Posted by
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.
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.
Re: UPS XML: Support Thread
Quote:
Originally Posted by
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!
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
HTML Code:
[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
Code:
$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
HTML Code:
[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
Code:
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;
}