If this is your first visit, check our documentation. To post, register or login.

Admin - Modules - Shipping issues

Started by cruiser on 3 Apr 2023, 5:37 PM · Views: 1,774

Results 1 to 7 of 7
3 Apr 2023, 5:37 PM
#1
cruiser avatar

cruiser

New Zenner

Join Date:
Aug 2006
Posts:
34
Plugin Contributions:
0

Post #1 by cruiser

Need help with this error below:

[03-Apr-2023 10:23:20 America/Los_Angeles] Request URI: /*****/index.php?cmd=modules&set=shipping&module=freeshipper, IP address: xx.xxx.x.xxx
#1 trigger_error() called at [/includes/classes/db/mysql/query_factory.php:667]
#2 queryFactory->show_error() called at [/includes/classes/db/mysql/query_factory.php:634]
#3 queryFactory->set_error() called at [/includes/classes/db/mysql/query_factory.php:275]
#4 queryFactory->Execute() called at [/includes/modules/shipping/usps.php:1096]
#5 usps->check() called at [/admin/modules.php:189]
#6 require(/admin/modules.php) called at [/admin/index.php:11]
--> PHP Fatal error: 1366:Incorrect string value: '\x99 Padd...' for column **database**.orders.shipping_method at row 61657 :: ALTER TABLE orders MODIFY shipping_method varchar(255) NOT NULL DEFAULT '' ==> (as called by) /includes/modules/shipping/usps.php on line 1096 <== in /includes/classes/db/mysql/query_factory.php on line 667.

I went into Tables, shipping_method is set to varbinary 255 / any ideas?

Getting shipping errors on checkout from customers and no display of options in admin/shipping modules.

3 Apr 2023, 5:53 PM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,761
Plugin Contributions:
56

Post #2 by swguy

Not sure how that field got to be varbinary but I guess it is now. For now you're going to have to remove the ALTER TABLE block from usps.php.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

3 Apr 2023, 6:53 PM
#3
cruiser avatar

cruiser

New Zenner

Join Date:
Aug 2006
Posts:
34
Plugin Contributions:
0

Post #3 by cruiser

Should it look like this now?:

    global $sniffer;
    $results = $sniffer->field_type(TABLE_ORDERS, 'shipping_method', 'varchar(255)', true);
    if ($results !== true) {
        $sql = "" . TABLE_ORDERS . " MODIFY shipping_method varchar(255) NOT NULL DEFAULT ''";
        $db->Execute($sql);
3 Apr 2023, 7:19 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,761
Plugin Contributions:
56

Post #4 by swguy

No. Remove that whole block of lines.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

3 Apr 2023, 7:39 PM
#5
cruiser avatar

cruiser

New Zenner

Join Date:
Aug 2006
Posts:
34
Plugin Contributions:
0

Post #5 by cruiser

Should I remove this chunk from the code?:

    }
    global $sniffer;
    $results = $sniffer->field_type(TABLE_ORDERS, 'shipping_method', 'varchar(255)', true);
    if ($results !== true) {
        $sql = "ALTER TABLE " . TABLE_ORDERS . " MODIFY shipping_method varchar(255) NOT NULL DEFAULT ''";
        $db->Execute($sql);
    }

====================================

 * check status of module
 *
 * @return boolean
 */
public function check()
{
    global $db;

    if (!isset($this->_check)) {
        $check_query = $db->Execute("SELECT configuration_value FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = 'MODULE_SHIPPING_USPS_STATUS' LIMIT 1");
        $this->_check = $check_query->RecordCount();
    }
    global $sniffer;
    $results = $sniffer->field_type(TABLE_ORDERS, 'shipping_method', 'varchar(255)', true);
    if ($results !== true) {
        $sql = "ALTER TABLE " . TABLE_ORDERS . " MODIFY shipping_method varchar(255) NOT NULL DEFAULT ''";
        $db->Execute($sql);
    }

    $this->notify('NOTIFY_SHIPPING_USPS_CHECK');
    return $this->_check;
}

/**
 * Install this module
 */
public function install()
3 Apr 2023, 8:00 PM
#6
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,761
Plugin Contributions:
56

Post #6 by swguy

Just these lines:

global $sniffer;
$results = $sniffer->field_type(TABLE_ORDERS, 'shipping_method', 'varchar(255)', true);
if ($results !== true) {
$sql = "ALTER TABLE " . TABLE_ORDERS . " MODIFY shipping_method varchar(255) NOT NULL DEFAULT ''";
$db->Execute($sql);
}

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

3 Apr 2023, 11:58 PM
#7
cruiser avatar

cruiser

New Zenner

Join Date:
Aug 2006
Posts:
34
Plugin Contributions:
0

Post #7 by cruiser

Thank you! Seems to be working well now.