Zen Cart Logo
Forums / Addon Payment Modules / Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

Locked

Views: 4,650

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
28 Mar 2009, 4:03 PM
#1
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

Hello all, :cry::cry::cry:.. I'm getting this error on the Order Complete Page when using Direct Bank Deposit payment method.:

1406 Data too long for column 'shipping_method' at row 1
in:
[INSERT INTO zc1_orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, payment_module_code, shipping_method, shipping_module_code, coupon_code, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, order_total, order_tax, currency, currency_value, ip_address) VALUES ('2', 'Hoho Hoe', '', '55', 'ggggw Rd', 'Mgggggld', '5144', 'South Australia', 'Australia', '5555555', '[email protected]', '1', 'Hoho Hoe', '', '55', 'Hilggggw Rd', 'Mgggggd', '5144', 'South Australia', 'Australia', '1', 'Hoho Hoe', '', 'sec 2755', 'Hsseffw Rd', 'Maggggd', '5144', 'South Australia', 'Australia', '1', 'Direct Bank Deposit', 'dirbank', 'AustPost ("Registered 3 "days)', 'austpost', '', '', '', '', '', now(), '1', '183.35', '15.445454545455', 'AUD', '1.00000000', '127.0.0.1 - 127.0.0.1')]
:censored:
(Some of the values changed for security reasons)
Apparently its something to do with shipping_method varchar(128)

How and where do I change this setting and what **value **should it be set to ?

29 Mar 2009, 12:14 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

remoteone:

Hello all, :cry::cry::cry:.. I'm getting this error on the Order Complete Page when using Direct Bank Deposit payment method.:

1406 Data too long for column 'shipping_method' at row 1
in:
[INSERT INTO zc1_orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, payment_module_code, shipping_method, shipping_module_code, coupon_code, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, order_total, order_tax, currency, currency_value, ip_address) VALUES ('2', 'Hoho Hoe', '', '55', 'ggggw Rd', 'Mgggggld', '5144', 'South Australia', 'Australia', '5555555', '[email protected]', '1', 'Hoho Hoe', '', '55', 'Hilggggw Rd', 'Mgggggd', '5144', 'South Australia', 'Australia', '1', 'Hoho Hoe', '', 'sec 2755', 'Hsseffw Rd', 'Maggggd', '5144', 'South Australia', 'Australia', '1', 'Direct Bank Deposit', 'dirbank', 'AustPost ("Registered 3 "days)', 'austpost', '', '', '', '', '', now(), '1', '183.35', '15.445454545455', 'AUD', '1.00000000', '127.0.0.1 - 127.0.0.1')]
:censored:
(Some of the values changed for security reasons)
Apparently its something to do with shipping_method varchar(128)

How and where do I change this setting and what **value **should it be set to ?

I've not seen that particular error message before, but I can speculate the cause based on a couple of similar things I've read, and it probably relates to the AustPost module rather than the Direct Deposit module.

There are 3 things that you can do.

  1. Increase the size of the data field for the shipping_method from 128 to 256.

  2. load the file /includes/languages/english/modules/shipping/austpost.php into a text editor and then edit the line that contains MODULE_SHIPPING_AUSTPOST_TEXT_TITLE by removing the image tags (replace it with plain text).

  3. Upgrade your AustPost shipping module by replacing it with the 'ozpost' Shipping module (which has taken care of the problem associated with fix#2).

I would suggest that to 'prove the point' fix#2 will be the quickest and safest thing to do. If this confirms the fix, then consider implementing fix#3.

Fix#1 should only be considered if fix#3 causes other unrelated problems AND you want to keep the AustPost icons.

Cheers
Rod

29 Mar 2009, 12:54 AM
#3
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

I see that , upon initial installation, zc sets the value of shipping_method in the orders table to 128
I changed this to 256 using phpMyAdmin but still get same error with Direct Bank Deposit module.
All help greatly appreciated.

29 Mar 2009, 1:30 AM
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

remoteone:

I see that , upon initial installation, zc sets the value of shipping_method in the orders table to 128
I changed this to 256 using phpMyAdmin but still get same error with Direct Bank Deposit module.
All help greatly appreciated.

I still think it is the same problem (and solution) previously discussed. You could try increasing the field width even further, say 512, and possibly even 1024. Doing so won't affect the way things work, it'll just increase the size of your database. However, it WILL cause you a problem if you ever reduce the size back to the original, because any existing data would end up being truncated.

Cheers
Rod

29 Mar 2009, 1:36 AM
#5
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

Hi RodG, Didnt see your post till I had saved that last post.

  1. Did I change the correct dB table? ie orders : shipping_method
  2. Thanks for the suggestions, I wanted to get rid if the austpost_logo.jpg image anyway.. Have replaced w 'AustPost'. I removed it all together using "define('MODULE_SHIPPING_AUSTPOST_TEXT_TITLE' , ' ');" .note must use a space ' ' not ''.
    Still getting the error tho'
  3. Hmmm. ..another module , another week of debugging..Still, i'll give it a go as fix1 & fix2 have made no difference

Maybe I need to also remove austpost.jpg ?
Cheers

29 Mar 2009, 1:46 AM
#6
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

Ok , I change the value of the value of shipping_method in the orders table to 1024,
now I have another similar error:

1406 Data too long for column 'title' at row 1
in:
[INSERT INTO zc1_orders_total (orders_id, title, text, value, class, sort_order) VALUES ('18', ' ("Registered 3 "days):', '$13.45', '13.45', 'ot_shipping', '200')]

29 Mar 2009, 2:02 AM
#7
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

Ok
I changed table orders_total title value to 1024
I think its working now.

RodG this prompts another question, how remove the ( that preceeds austpost_regd.jpg and the ): that follows austpost_del.jpg ?
They look a bit odd there next to the images

(Registered Parcel Post 3 days Est Delivery):
alternatively
maybe replace the austpost_regd.jpg and austpost_del.jpg image references w text.
Thanks

29 Mar 2009, 2:15 AM
#8
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

Hmmm ..this is something that should be fixed for the ZenCart installation .
These SQL tables need to be set larger in case shops want to use AustPost and Direct Bank Deposit .. much time wasted on such a fundamental issue.

Thanks for your help, your a champion RodG !

29 Mar 2009, 2:28 AM
#9
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

To avoid this on inital install, changing the lines in ** \zencart\zc_install\sql\mysql_zencart.sql** prior to install might do the trick.
or maybe a sqlQuery file included with DBD and/or AustPost modules downloads

CREATE TABLE orders (
shipping_method varchar(1024) NOT NULL default '',

and
CREATE TABLE orders_total (
title varchar(1024) NOT NULL default '',

Thanks again.

29 Mar 2009, 2:52 AM
#10
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

remoteone:

Hmmm ..this is something that should be fixed for the ZenCart installation .
These SQL tables need to be set larger in case shops want to use AustPost and Direct Bank Deposit

I kinda disagree, I'm sure the zencart developers chose the smaller field size for a reason, and by making it bigger to compensate for the AustPost issue is only really hiding the problem. The fact is, the module "titles" were never intended to be replaced with icons/images, and by doing so with the AustPost module I actually deviated from the standard.

This is/was one of the things that I have rectified in the 'ozpost' module.

Cheers
Rod

29 Mar 2009, 3:06 AM
#11
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

remoteone:

Ok
I changed table orders_total title value to 1024
I think its working now.

RodG this prompts another question, how remove the ( that preceeds austpost_regd.jpg and the ): that follows austpost_del.jpg ?
They look a bit odd there next to the images

(Registered Parcel Post 3 days Est Delivery):
alternatively
maybe replace the austpost_regd.jpg and austpost_del.jpg image references w text.
Thanks

Again, the implementation of the icons in the AustPost module are seriously flawed. Other than hacking the code there is no other way to enable/disable them. There are several threads covering this same issue (do a search for "AustPost icons".

For a proper and compliant fix (without hacking the code) the best/easiest solution is to use the 'ozpost' module instead of 'AustPost'

Although functionally pointless, both modules can be installed and operational at the same time, this means that you can install and verify the operation of the new module without the need to uninstall your existing AustPost module. When satisfied that the new module is working ok it is just a matter of disabling or uninstalling the old.

The new module is also faster, is more accurate with letter sized items, has much better debugging information (should it be needed), is far more manageble (most of the 'work' is now done on the server rather than the client), as well as several other minor bugfixes and changes.

I also suspect that the 'AustPost' module will have problems with the zencart V2 release, whereas the 'ozpost' module, being fully OOP compliant is unlikely to have any issues.

If that isn't enough, I am no longer doing any further development with the 'AustPost' code, the 'ozpost' module is the way of the future.

Cheers
Rod

29 Mar 2009, 3:13 AM
#12
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

remoteone:

I removed it all together using "define('MODULE_SHIPPING_AUSTPOST_TEXT_TITLE' , ' ');" .note must use a space ' ' not ''.
Still getting the error tho'

Two points.

  1. After making changes to the definition files you must almost certainly close your browser and re-open it, otherwise you will be seeing cached data.

  2. The change you made will probably not work. The module MUST have a title, because zencart uses this for identification purposes. A suitable change would be:
    "define('MODULE_SHIPPING_AUSTPOST_TEXT_TITLE' , 'AustPost ');"

Cheers
Rod

30 Mar 2009, 1:53 PM
#13
remoteone avatar

remoteone

Zen Follower

Join Date:
Jan 2009
Location:
Macclesfield, South Australia
Posts:
104
Plugin Contributions:
0

Re: Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

RodG,

  1. Yeah I'm onto that re-load trick, long ago .. A trap for young players tho', well worth mentioning.

  2. For other reasons , I changed the title to "Australia Post" and used a smaller image for the next icon .. looks great....
    http://www.remoteone.com.au

Thanks for the help, .. now I have a new problem after installing F**ast n Easy Checkout **(FEC) mod . The Cheapest Shipping method is normally selected by default. But with FEC installed, **NO method **is selected, causing calculation errors on the first load of the checkout page, when using the single page Checkout.. Have you had any issues w AustPost and FEC compatability in the past ?

I will start a new thread for this but, as usual I cant find the !!@#$% "new Post" button again.!
Thanks again.

30 Mar 2009, 11:24 PM
#14
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Direct Bank Deposit - 1406 Data too long for column 'shipping_method'

remoteone:

Have you had any issues w AustPost and FEC compatability in the past ?
.

None have been reported, but that doesn't mean much. For various reasons a lot of people never seem to report problems.

Cheers
Rod