1

Products with custom input values are not saving their entire length and the customer invoice is clipped at the first 32 characters.

One product in a store I'm working on has a test area for a user to input custom values for the product.

This product attribute is set to 150 characters in length via the admin, but when someone orders it and fills it out, the information they enter is cut off after the 32nd character when viewed on the invoice page.

What can I do to remedy this?

random
  • 9,774
  • 10
  • 66
  • 83
user1917147
  • 71
  • 1
  • 4

1 Answers1

3

Your database column is too small to capture the free text field, despite what you may have set it to in the admin.

When an order is placed, any attributes per item in the shopping cart will be saved to the orders_products_attributes table. If a text field is part of the attributes a customer can specify, this will be saved in the products_options_values column per that item's row.

By default this is a varchar(32) column. Which means even if you set it to 255 in the admin console, the database will only keep the first 32 characters.

You can jump into the database via phpMyAdmin or Adminer and run this SQL to bump up the column field size:

ALTER TABLE orders_products_attributes
 CHANGE products_options_values 
 products_options_values varchar(250) NOT NULL DEFAULT '';

The above SQL will update the size of the products_options_values column to a maximum length of 250 characters. Adjust this as needed.

Now, all future purchases, where a free text product attribute is included, will show up to the 250 characters in the invoice.

random
  • 9,774
  • 10
  • 66
  • 83