Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Upgrading Your Zen Cart / Upgrading to 1.5.x / Confirm Purchase fails if lenght of COD message is too long

Confirm Purchase fails if lenght of COD message is too long

23 Jul 2014, 2:27 AM
#1
loveofthehorse avatar

loveofthehorse

New Zenner

Join Date:
Jul 2014
Location:
Blanchard, Idaho USA
Posts:
21
Plugin Contributions:
0

Post #1 by loveofthehorse

While testing an upgrade locally I found that confirming a purchase consistently failed. Here is the content of the log related to the failure.

[22-Jul-2014 18:55:02 America/Los_Angeles] PHP Fatal error: 1406:Data too long for column 'payment_method' at row 1 :: INSERT INTO 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 ('7', 'Mark McBride', '', '5584 NW 149th Ct', '', 'Portland', '97229', 'Oregon', 'United States', '503-840-4049', 'hikinginpdx2######################', '2', 'Mark McBride', '', '5584 NW 149th Ct', '', 'Portland', '97229', 'Oregon', 'United States', '2', 'Mark McBride', '', '5584 NW 149th Ct', '', 'Portland', '97229', 'Oregon', 'United States', '2', 'Cash on Delivery - Must be pre-approved with Love of the horse and will only be honored when paired with store pickup and when combining orders for partner Barns or Events.', 'cod', 'Store Pickup (Customer Pickup)', 'storepickup', '', '', '', '', '', now(), '1', '6.75', '0', 'USD', '1.00000000', '::1 - ::1') ==> (as called by) C:\Web\includes\functions\functions_general.php on line 964 <== in C:\Web\includes\classes\db\mysql\query_factory.php on line 155

This functioned in 1.5.1. I shorted the COD message within includes/languages/english/modules/payment/cod.php , refreshed and was then able to complete the purchase process.

Not sure if I have missed a fix during the upgrade or if there is now a limit to the length of 'MODULE_PAYMENT_COD_TEXT_TITLE' or 'MODULE_PAYMENT_COD_TEXT_DESCRIPTION'

26 Jul 2014, 2:55 AM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,934
Plugin Contributions:
26

Post #2 by dbltoe

You haven't answered some of the posting tip questions but it seems like you have a mod that is not 1.5.3/PHP 5.4 ready.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

30 Jul 2014, 9:02 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #3 by drbyte

There was no change to this between v1.5.1 and v1.5.3.
It could be that your localhost webserver is implementing stricter database rules due to an upgrade to mysql.

The cause is simply that the Zen Cart database is built to accept 128 characters for the payment method name, and you were using more than that, namely 173.
eg: 'Cash on Delivery - Must be pre-approved with Love of the horse and will only be honored when paired with store pickup and when combining orders for partner Barns or Events.'

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.