Guest mattmoo Posted May 14, 2010 Share Posted May 14, 2010 Some of my product options attributes are quite long (text length) and although I am able to type the full option in "product attributes" when it views in the store the end part of each attribute is missing. Is there a way I can increase the character length that will display in the drop down list? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
Guest dawng22 Posted August 23, 2011 Share Posted August 23, 2011 I have the same problem. Did you ever figure it out? Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 23, 2011 Share Posted August 23, 2011 There appears to be no HTML coding limit to the amount of text you can enter into the form's <input> text box. And there may be a style applied to the Product View page's Options selectors that would limit its width. However, when the CC4 database is built during installation, the name of the option (managed in Table 1) is stored in the database _options_top having a column width of 30. The option's attribute (or value, managed in Table 2) is in the _options_mid and has a similar column width. Unless the MySQL database is set to strict mode (and it can't as there are way too many other query situations that would fault on a strict mode database), the database simply truncates everything past the 30th character. To get relief, you would have to get at your database directly and issue the necessary ALTER command. Quote Link to comment Share on other sites More sharing options...
leeofaccy Posted August 24, 2011 Share Posted August 24, 2011 As Brian mentions, the max length of the string is set to 30 chars in the database. Anything after the 30th character is dropped. You can try an ALTER statement to change the length. Backup your database first! (Maintenance > Backup in admin menu) Under the Maintenance tab in your admin menu, click the Database link. Just above the table you will see a line that looks *something* like this... MySQL 5.1.56-community-log running on localhost as YOUR_DB_NAME@localhost » Click the >> at the end of that line, then in the box that next appears paste in the following. You can change the number (from 40), to the value of your longest option attribute if need be. ALTER TABLE `CubeCart_options_mid` CHANGE `value_name` `value_name` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT \'\' Click 'Execute SQL Queries' Your existing attributes will still only be 30 chars long max because of the 'dropped' characters. You will have to go back into Product Options and add the rest......only hope you don't have many Hope that helps Lee Quote Link to comment Share on other sites More sharing options...
Guest dawng22 Posted August 24, 2011 Share Posted August 24, 2011 Crud!! I've tried all those things and it still indicating the limit is "30." Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 24, 2011 Share Posted August 24, 2011 What is indicating a limit? So CubeCart permits the admin to submit a custom SQL command statement to the database (which I didn't know about - thanks leeofaccy), I would hope that it takes the statement and makes sure tables have the prefix assigned. Did you include your table prefix in the statement? (Are the backslashes necessary?) Also, recall I mentioned a similar limit in the _options_top table for option name. Quote Link to comment Share on other sites More sharing options...
leeofaccy Posted August 24, 2011 Share Posted August 24, 2011 I have tested this on my dev site and it worked for me. Yes, the backslashes ARE necessary Brian, it throws an error if you leave them out. The program that controls the 'query' page will insert the prefix. Lee Quote Link to comment Share on other sites More sharing options...
Guest dawng22 Posted August 24, 2011 Share Posted August 24, 2011 I submitted the SQL command just as Lee suggested through CubeCart admin and even tried editing and adding a new product option attribute, but when you go back to the website's drop-down it's still missing/dropping letters off the end. Afterwards, I went into the MySQL and saw that the value was still set at a limit of 30. Am I doing something wrong? Quote Link to comment Share on other sites More sharing options...
leeofaccy Posted August 24, 2011 Share Posted August 24, 2011 When you executed the query, did you get a statement appear above the box, something like this?... ALTER TABLE `CubeCart_options_mid` CHANGE `value_name` `value_name` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' 3 row(s) affected Quote Link to comment Share on other sites More sharing options...
Guest dawng22 Posted August 24, 2011 Share Posted August 24, 2011 This is what I got: ALTER TABLE `CubeCart_options_mid` CHANGE `value_name` `value_name` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' 459 row(s) affected Quote Link to comment Share on other sites More sharing options...
leeofaccy Posted August 24, 2011 Share Posted August 24, 2011 That *should* have done it. Can you check the options_mid table in phpMyAdmin and see if it has changed to 40? If it is already open try refreshing the page and see if the value has changed. Quote Link to comment Share on other sites More sharing options...
Guest dawng22 Posted August 24, 2011 Share Posted August 24, 2011 It works now!! It must have taken when I ran it the second time. Thanks so much!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.