Jump to content
cinolas

Product option values longer than 32 chars cause problems

Recommended Posts

I'm using osC 2.3.4 BS

I recently moved to a new host and with that came a change in the active PHP version to 5.4.45 from a previous 5.x version. (I believe the PHP version is what's causing my problems, I could be wrong).

After the move I started getting errors about incorrect integer values in the SQL insert when creating new products, which I fixed by adding the correct (float) and (int) in front of my tep_db_prepare_input calls. I believe that prevents the values from being inserted as ''. This wasn't a problem with the previous PHP version.

Another problem I'm having is when checking out with a product that has an attribute option value that is longer than 32 characters. First it generated an error in the browser that said:

 Data too long for column 'products_options_values' at row 1

This also wasn't a problem before the move, the data in the field simply got truncated at 32 chars. So I changed the length of the fields products_options and products_options_values in orders_products_attributes from 32 to 64 and that fixed that error message, HOWEVER users with products that have attribute values longer than 32 chars still cannot checkout. The Confirm Order button presses but nothing happens. This is not a problem when only products with short attribute values are being purchased.

So obviously I need to expand the character limit for my attribute values somewhere else as well for this to work, but where?

Any help is greatly appreciated!

Edited by cinolas

Share this post


Link to post
Share on other sites

In an emergency measure, to make sure my customers could check out, I shortened all my long attribute values to less than 32 chars.

But checkout still doesn't work. Even if I delete the product from my cart and re-add it with the short attribute value, the Confirm Order button just doesn't do anything (my CC isn't getting charged either).

So that may not my problem. Why would some products allow Checking Out and not others. How do I debug the Confirm Order button behaviour to see what the problem is?

Edited by cinolas

Share this post


Link to post
Share on other sites

It sounds like although you increased the length of the product_attributes you didn't change the matching order_product_attributes. Can you supply the create table sql's for your product and order tables?

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×